Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Tesla API Call in cURL -- Help Please

This site may earn commission on affiliate links.
I'm trying to use cURL to do the authentication and get an access token but have been unable to get the proper format together. I am trying:

curl -H "Content-Type: application/json" -d {"grant_type" : "password", "client_id" : "***", "client_secret" : "***", "email" : "***", "password" : "***" } https://owner-api.teslamotors.com/oauth/token

Any help would be much appreciated.

Thanks!

Courtesy of the evMote "team" ;)

curl --include --data "grant_type=password&client_id=xxxxxxxxxxx&client_secret=xxxxxxxx&[email protected]&password=xxxxxxxxx" --request POST 'https://owner-api.teslamotors.com/oauth/token'