sebas
Member
@LastGas to login the parameters are a send "x-www-form-urlencoded" which basically is to concatenate all the values in the body as plain text. What I'm using to test the different API calls is Postman. Great tool to work with any api and it can return the request in e.g. cURL or JS code.
This is the cURL command to login. Change your credentials to test it.
This will return a JSON object with the token you will need to add to subsequent requests. The token is added in the Authorization header prefixed with "Bearer ".
This is the cURL command to login. Change your credentials to test it.
Code:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Accept-Encoding: application/json" -d 'grant_type=password&client_id=e4a9949fcfa04068f59abb5a658f2bac0a3428e4652315490b659d5ab3f35a9e&client_secret=c75f14bbadc8bee3a7594412c31416f8300256d7668ea7e6e7f06727bfb9d220&email=YOUR_EMAIL_HERE&password=YOUR_PASSWORD_HERE' "https://owner-api.teslamotors.com/oauth/token"
This will return a JSON object with the token you will need to add to subsequent requests. The token is added in the Authorization header prefixed with "Bearer ".