WoBike icon indicating copy to clipboard operation
WoBike copied to clipboard

Voi api return empty list

Open adrz opened this issue 6 years ago • 5 comments

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}]

adrz avatar Feb 15 '19 10:02 adrz

Strange. Both of your examples of calls worked fine for me.

William04A avatar Mar 29 '19 18:03 William04A

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.

monsieurhannes avatar Apr 13 '19 13:04 monsieurhannes

The correct parameters are lat and lng for the v1/vehicle/status/ready api.

The App uses another way to get the available scooters:

  1. Get all Zones for the current location: v1/zones?lat=...&lng=.... This Endpoint requires the X-Access-Token-Header.
  2. Get Zone Polygon: v1/zones/zone/{id}/areas (returns geojson)
  3. Get available Scooters: v1/vehicles/zone/{id}/ready

robbi5 avatar Apr 13 '19 14:04 robbi5

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.

William04A avatar Apr 17 '19 17:04 William04A

@robbi5 Do you happen to have the request that is necessary to get the token from the phone number?

lucmartinon avatar Dec 20 '19 17:12 lucmartinon