ubahnverleih / WoBike

Documentation of Bike Sharing APIs 🚴🛴🛵
943 stars 132 forks source link

Helbiz scooters key error #158

Open Rcheck90 opened 4 years ago

Rcheck90 commented 4 years ago

Hi, I am quite new using Python, and I'm trying to get sccoters information from the Helbiz API following the code in https://github.com/ubahnverleih/WoBike/blob/master/Helbiz.md . The script works well: I could authenticate myself and got region information, but when I try to get scooters positions something doesn't work. Can you please help me with this issue? I put part of the script below:

`token = '...' headerReq = {"X-Requested-With": "XMLHttpRequest", "User-Agent": "Helbiz (com.helbiz.android)", "Content-Type": "application/json", "X-access-token": token}

Helbbox = requests.get('https://api.helbiz.com/prod/regions', headers=headerReq) #it works!

Helbbox = requests.get('https://api.helbiz.com/prod/scooters?northWest=45.076577,7.674451&southEast=45.070343,7.678076', headers=headerReq)

it raises this error: response 500 Helbbox.text '{"message":"Internal error","key":"error"}'`

Thank you in advance for your help

etis11 commented 4 years ago

How did you even authenticate?I tried with myself and keep getting "{"message":"User not found","key":"not_found"}"

RobertoMilani commented 4 years ago

I've tried to authenticate -> successfull authenticated, token obtained Just after few seconds I tried: https://api.helbiz.com/prod/scooters?northWest=42.011841,12.299143&southEast=41.770579,12.691217 (Scooters in Rome) using just obtained token and it worked!

So, I can suggest to query the scooters API just after authentication (I don't know the token expire time)