ubahnverleih / WoBike

Documentation of Bike Sharing APIs 🚴🛴🛵
957 stars 131 forks source link

Add new provider: Movo #128

Open lucmartinon opened 5 years ago

lucmartinon commented 5 years ago

Hello there! Thanks a lot to everybody who participated in this repo, this is a gem!

Movo is a provider of e-scooters in Madrid and different cities of South America.

From what I see with charles:

bransonf commented 5 years ago

If you're using a web proxy, you just need to trace the requests made by the app. Since it sounds like you're already using Charles, just trace the steps of the application. I'm not sure how Facebook's authentication works with movo, but all that is important is that you somehow get an access token for movo, assuming there is one.

You should be able to find a POST request made to that url s0.movo.me at some endpoint, which probably has a JSON body like:

{
   "token": "xyzxyzxyzxyz"
}

I have no idea what it actually looks like, but you just need to be able to trace the body and headers made with the POST request to get scooter locations.

mitmproxy might be more friendly than Charles, and here is a good medium post on getting started with it.

lucmartinon commented 5 years ago

hum, as far as I can see, with Charles I cannot see the details of the https traffic, so the only thing I get is the server name, although certificate is installed on my device. With MITM the app sees that there is a proxy and stops totally the communication. So for now I'm a bit blocked, will keep trying though.

jhoogstraat commented 5 years ago

For me I got a GET request to https://core.2hire.io/v4/user/api/sharing/vehicle

Query Headers:

Query Params:

Here is a example for the "filters" parameter: { "_self" : { "longitude" : [ -3.7166256672308293, -3.6881143327691177 ], "type" : [ "kick", "scooter" ], "latitude" : [ 40.397951408697942, 40.435403379517375 ] } }

lucmartinon commented 5 years ago

@jhoogstraat very cool, thanks! could you describe how you did it? by chance have you also catched the request for the One Time Password that allow to get the tokens ?

thanks!

jhoogstraat commented 5 years ago

The login process seems to be a bit more involved as it uses Facebooks AccountKit.

The most important Request seems to be to https://core.2hire.io/v4/user/login/accountkit But the request body contains some code from AccountKit.

Query params are:

Query body contains: code=<VeryLongCode>

The response looks something like this: { "status" : true, "error" : null, "data" : { "token" : { "expire" : 1425744595164, "UserId" : 111111, "id" : 1234567, "code" : <token>, "clientType" : 0, "created_at" : "2019-10-04T15:12:11.000Z", "updated_at" : "2019-10-04T15:12: 11.000Z", "unlimited" : false } } }

I have no experience with AccountKit. Someone else might be able to help here.

I logged the requests with FLEX for ios.