thomasdye12 / Mercedes-Me-API

1 stars 0 forks source link

Missing docs #1

Open bircni opened 1 week ago

bircni commented 1 week ago

Hey! I wanted to try out your project but there seems to be no specification about the auth.json I need

thomasdye12 commented 1 week ago

Hi, sorry yes that my bad, it should work if you just make the auth.json file, its just the auth data from Mercedes. should look like this { "access_token": "", "token_type": "Bearer", "expires_in": 0000, "expires_at": 0000 }

You can get it if you proxy the app traffic when you login it will return with a response that looks like this minus the expires_at time, you can also hit the 2 end points for logging in /Login/:username with the email, and then /Login_Code/:username/:code with the email and the code and it should work.

let me know if you have any issue s

bircni commented 1 week ago

the return seems to always be a 400 BadRequest

What i did:

thomasdye12 commented 1 week ago

Hi,

The issue is you've used the leading : eg it should be /Login/hello@world.com

All the routes are in the support routes file if you want to look at them.

The : is a standard thing in express inline variables, can be omitted from the query

bircni commented 1 week ago

OOps xD

Is there a list which states i can request and which commands i can execute?

thomasdye12 commented 1 week ago

Hi,

That’s one of the things I’m kinda still working on, there is a list of commands that can be sent in the proto folder then vehicle-commands_pd.js at about like 1409, these are the command names for the commands that can be sent eg DoorUnlock, DoorLock. It’s a bit hit and miss on what works and what doesn’t really work. Door unlock and lock works, for all doors. However other things should work but require other details that I’m yet to work out.

To get the current state of your car, there is an end point get /Car/:CarID/listStates where carID is the vin number, should have been logged to the console on successful connection of the socket. You can use /Car/:CarID/All for all the states and all the values, And /Car/:CarID/:state for a single state with values.

In the carConfigMaps.js file you can see the info about the commands I’ve used at the bottom and the state values that represent what your interested in

Eg for DoorsUnlock command it will update the vehicleLockState which is represented by the intValue returned from the array above.

Some commands request other commands and most haven’t been tried as I don’t really have a use, I just want basic control from my phone on the IOS Lock Screen which is what this does for me.

Hope that helps