WoBike icon indicating copy to clipboard operation
WoBike copied to clipboard

Bird: API Call returns 404

Open Binternet opened this issue 6 years ago • 9 comments

When firing a cURL request via my local machine I get a valid 200 response, when using the exact same cURL call via an AWS instance I get a 404 response code.

Here's my cURL request:

curl -I -X GET \
 'https://api.bird.co/bird/nearby?radius=1000' \
 -H 'App-Version: 3.0.5' \
 -H 'Authorization: Bird <MY_TOKEN_HERE>' \
 -H 'Cache-Control: no-cache' \
 -H 'Device-id: 123E4567-E89B-12E3-A452-426655440000' \
 -H 'Location: {"latitude":33.754709,"longitude":-84.390793,"altitude":500,"accuracy":100,"speed":-1,"heading":-1}'

Any ideas why?

Binternet avatar Aug 07 '18 14:08 Binternet

Looks good to me, should works. Maybe your token is restricted to one IP. Try to login on you AWS instance and use it

PierrickP avatar Aug 07 '18 17:08 PierrickP

Tried the same exact call on a different, non-AWS instance and it works. tried from two different AWS EC2 instances and it returned 404, i think they might be blocking AWS's IP addresses.

Binternet avatar Aug 07 '18 18:08 Binternet

Hum, actually i have something identical on my CI (travis, not all the time) Which region do you use ?

for information: https://ip-ranges.amazonaws.com/ip-ranges.json

PierrickP avatar Aug 08 '18 07:08 PierrickP

Checked from N.Virgina and Ireland. Other non-AWS instance does work. it seems they block AWS's EC2 IP ranges.

Binternet avatar Aug 08 '18 07:08 Binternet

maybe someone tried to scrape the data from EC2, and they blocked it by blocking the IP ranges?

ubahnverleih avatar Aug 08 '18 15:08 ubahnverleih

@ubahnverleih yeah it could be something automatic. The IP range can be working next day

PierrickP avatar Aug 08 '18 15:08 PierrickP

Same thing on my server ip (not AWS) :\

PierrickP avatar Aug 17 '18 16:08 PierrickP

I think they have been auto-blocking IP ranges with high volumes of calls.

jacobbaskin avatar Sep 05 '18 15:09 jacobbaskin

They will block IP ranges from time to time. You also have to get new tokens every once in awhile. To do this, you need to pass in a different email address to request the token.

pmdbt avatar Jan 31 '19 23:01 pmdbt