Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update api urls & add user-agent header #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matiasneil
Copy link

Minor changes have been made to make the code work again.

@yunathan51
Copy link

yunathan51 commented Jul 17, 2024

Does this work? Trying to test the endpoint through Postman but Incapsula blocks any results

@matiasneil
Copy link
Author

matiasneil commented Jul 17, 2024

Does this work? Trying to test the endpoint through Postman but Incapsula blocks any results

It's working for me, did you modify the User-Agent header like I did on these changes? Make sure Postman is not sending its own value there.

@yunathan51
Copy link

I did, i have no idea of what I'm doing wrong. I'm going to send my cURL request here. I would appreciate it if you could help me. I have 0 experience with Go since i mainly develop with Java/Python

curl ^"https://api-air-flightsearch-green.smiles.com.br/v1/airlines/search?cabin=ALL&originAirportCode=FLN&destinationAirportCode=GRU&departureDate=2024-10-16&memberNumber=&adults=1&children=0&infants=0&forceCongener=false&cookies=_gid^%^3Dundefined^%^3B^" ^
-H "accept: application/json, text/plain, /" ^
-H "accept-language: pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7" ^
-H "channel: WEB" ^
-H "origin: https://www.smiles.com.br" ^
-H "priority: u=1, i" ^
-H "referer: https://www.smiles.com.br/" ^
-H ^"sec-ch-ua: ^^"Not/A)Brand^^";v=^^"8^^", ^^"Chromium^^";v=^^"126^^", ^^"Google Chrome^^";v=^^"126^^"^" ^
-H "sec-ch-ua-mobile: ?0" ^
-H ^"sec-ch-ua-platform: ^^"Windows^^"^" ^
-H "sec-fetch-dest: empty" ^
-H "sec-fetch-mode: cors" ^
-H "sec-fetch-site: same-site" ^
-H "user-agent: Mozilla/5.0 ^
-H "x-api-key: aJqPU7xNHl9qN3NVZnPaJ208aPo2Bh2p2ZV844tw"

@matiasneil
Copy link
Author

Try importing mine on Postman

curl --location 'https://api-air-flightsearch-green.smiles.com.br/v1/airlines/search?adults=1&cabinType=all&children=0&currencyCode=ARS&departureDate=2024-09-20&destinationAirportCode=EZE&forceCongener=true&infants=0&isFlexibleDateChecked=false&originAirportCode=PUJ&r=ar&tripType=2'
--header 'Accept-Encoding: gzip, deflate, br, zstd'
--header 'Channel: Web'
--header 'Language: es-ES'
--header 'Origin: https://www.smiles.com.ar'
--header 'Priority: u=1, i'
--header 'Referer: https://www.smiles.com.ar/'
--header 'Region: ARGENTINA'
--header 'User-Agent: Mozilla/5.0'
--header 'X-Api-Key: aJqPU7xNHl9qN3NVZnPaJ208aPo2Bh2p2ZV844tw'

@yunathan51
Copy link

This one works!! I also noticied something funny, when the request is successful it will return three cookies which are gonna be stored on postman, if you send another request without removing those three cookies Incapsula will block the request
image

@albertoivo
Copy link

albertoivo commented Sep 23, 2024

Hello.
Does this credentials still work?
If so, could you please send me a working cURL command ?
When I ran the cURL above I got this error:
Incapsula incident ID: 1615000190053895220-72854641289659597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants