WoBike
WoBike copied to clipboard
Voi api return empty list
It seems that the API of Voi has changed a bit. The api no longer return any scooter with the following call:
https://api.voiapp.io/v1/vehicle/status/ready?la=59.329323&lo=2.348791
Surprisingly, a slightly different call seems to half work:
https://api.voiapp.io/v1/vehicle/status/ready?lat=59.329323&lo=2.348791
[{"id":"90f6b36e-06f9-ea8b-934a-c7b92b630b1e","short":"k7tw","name":"VOI","zone":1,"type":"btv1","status":"ready","bounty":7000,"location":[59.3201975,0],"battery":18,"locked":true,"updated":"2019-02-15T08:45:16.032424Z","mileage":0}]
Strange. Both of your examples of calls worked fine for me.
I have the same experience, lat=
works, la=
returns an empty list.
Another thing I noticed, the returning scooters are not related to the latitude or longitude I search for. https://api.voiapp.io/v1/vehicle/status/ready?lat=55.5&lo=12.9
returns scooters in France and Spain, not Sweden, where the location would lead to.
The correct parameters are lat
and lng
for the v1/vehicle/status/ready
api.
The App uses another way to get the available scooters:
- Get all Zones for the current location:
v1/zones?lat=...&lng=...
. This Endpoint requires theX-Access-Token
-Header. - Get Zone Polygon:
v1/zones/zone/{id}/areas
(returns geojson) - Get available Scooters:
v1/vehicles/zone/{id}/ready
Seems like they have changed the API a bit. @robbi5, as you seem to have reverse-engineered the new API, is there a possibility that you can start a new pull-request and rewriting the file Voi.md a bit? I can also possibly do that.
@robbi5 Do you happen to have the request that is necessary to get the token from the phone number?