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

Model S REST API

This site may earn commission on affiliate links.
Quick question, I was wondering the other day how the API reacts to an account with more than one Tesla? More specifically how does it format the JSON response? For example, the API call for getting the car info such as ID and Display name, how would the API separate the independent values? Is is comma separated?
An example I thought of below:

"response": [{
"color": null,
"display_name": null,
"id": 321,
"option_codes": "MS01,RENA,TM00,DRLH,PF00,BT85,PBCW,RFPO,WT19,IBMB,IDPB,TR00,SU01,SC01,TP01,AU01,CH00,HP00,PA00,PS00,AD02,X020,X025,X001,X003,X007,X011,X013",
"user_id": 123,123,
"vehicle_id": CAR1ID,CAR2ID,
"vin": "CAR1VIN","CAR2VIN",
"tokens": ["x", "x"],
"state": "online","offline"
}],
"count":2
}
 
I didn't see that in the API docs - is that website (Tesla Model S JSON API · Apiary) still being updated? If not where is the best current info?
I don't think Tim Dorr is updating those docs. So any new API endpoints are to be discovered by us and documented on this thread. As to the new is_climate_on field, I have done some testing and it seems to be broken just like the older field. Both seem to stay on false all the time.
 
I don't think Tim Dorr is updating those docs. So any new API endpoints are to be discovered by us and documented on this thread. As to the new is_climate_on field, I have done some testing and it seems to be broken just like the older field. Both seem to stay on false all the time.
We should come up with a better way than having them in this thread as useful info will get buried in a huge thread. Can someone fork the Apiary site and maintain it?
 
I'm using Homeseer, Home automation software, to control my Tesla.

Honk the horn works with:
&hs.URLAction("https://owner-api.teslamotors.com/api/1/vehicles/XXXXXXXXXXX/command/honk_horn" , "POST", "", "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

But when i try to set the temp, the temp changes to LO:

&hs.URLAction("https://owner-api.teslamotors.com/a...et_temps?driver_temp=25.0&passenger_temp=25.0" , "POST", "", "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

And the same thing for the Pano Roof, it doesn't move:

&hs.URLAction("https://owner-api.teslamotors.com/a...ommand/sun_roof_control?state=open&percent=50" , "POST", "", "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Any ideas?
 
I'm using Homeseer, Home automation software, to control my Tesla.

Honk the horn works with:
&hs.URLAction("https://owner-api.teslamotors.com/api/1/vehicles/XXXXXXXXXXX/command/honk_horn" , "POST", "", "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

But when i try to set the temp, the temp changes to LO:

&hs.URLAction("https://owner-api.teslamotors.com/a...et_temps?driver_temp=25.0&passenger_temp=25.0" , "POST", "", "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

And the same thing for the Pano Roof, it doesn't move:

&hs.URLAction("https://owner-api.teslamotors.com/a...ommand/sun_roof_control?state=open&percent=50" , "POST", "", "Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXX")

Any ideas?
Attaching the query to the URL is not how you do a POST. That's how you do a GET.
 
  • Informative
Reactions: markwj