Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register
  • We just completed a significant update, but we still have some fixes and adjustments to make, so please bear with us for the time being. Cheers!

Model S REST API

SeBsZ

Former Vendor
Aug 1, 2017
1,052
1,052
The Netherlands
Just a heads up, most of the media controls are the same media_toggle_playback, those need to be changed to media_next_track, media_previous_track, media_next_favorite and media_previous_favorite.
 
  • Like
Reactions: SG57

SG57

Former Vendor
Jul 24, 2016
400
570
Spokane, WA
Heh, but still wrong, I think. favorite, not fav right? Oh, and previous, not prev.
Actually no the API endpoints are abbreviated like that, here's a snippet from the official app's endpoints container.
Code:
  "MEDIA_TOGGLE_PLAYBACK": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_toggle_playback",
    "AUTH": true
  },
  "MEDIA_NEXT_TRACK": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_next_track",
    "AUTH": true
  },
  "MEDIA_PREVIOUS_TRACK": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_prev_track",
    "AUTH": true
  },
  "MEDIA_NEXT_FAVORITE": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_next_fav",
    "AUTH": true
  },
  "MEDIA_PREVIOUS_FAVORITE": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_prev_fav",
    "AUTH": true
  },
  "MEDIA_VOLUME_UP": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_volume_up",
    "AUTH": true
  },
  "MEDIA_VOLUME_DOWN": {
    "TYPE": "POST",
    "URI": "api/1/vehicles/{vehicle_id}/command/media_volume_down",
    "AUTH": true
  },
 

ACDriveMotor

Member
Aug 11, 2013
890
24
Seattle, WA
Has anyone else noticed that the format of scheduled_charging_start_time changed with the latest FW? Previously it was a numeric value and now a string. Pretty easy to detect and correct across FW versions but otherwise an annoyingly arbitrary change.
 
  • Like
Reactions: SG57

SG57

Former Vendor
Jul 24, 2016
400
570
Spokane, WA
@ACDriveMotor , yes I received reports of that last week, latest firmwares now use a string format for the scheduled time (yyyy-MM-dd'T'HH:mm:ss) instead of a timestamp.

Interesting to note is this breaks the official app as it expects a timestamp with no support for a time string.
 

SG57

Former Vendor
Jul 24, 2016
400
570
Spokane, WA
So Elon's tweet confirms new Summon features coming to AP v2+ hardware vehicles in about 6 weeks from now. Looking forward to them, however I don't have a AP v2 vehicle, I just missed that boat in 2016 by 6 weeks :'(

I guess this means one of you lucky ducks will need to do the dirty work on actually testing anything discovered from the official app's source ;)
 

SG57

Former Vendor
Jul 24, 2016
400
570
Spokane, WA
Can anyone with a Model 3 confirm they are able to track their vehicle's live location while driving in the official Tesla app? Or if perhaps if there's a setting in the car that disables streaming? Try turning Summon off and try again, and the energy saver / always connected settings.

I'm seeing the official app set the initial position (from the drive state), but after sniffing traffic I'm seeing it fail to connect to the streaming endpoint with a "vehicle_disconnected" error. This is the exact same issue I've been seeing with Model 3s the past month in my own app I posted about earlier, trying to confirm this is a Tesla server-side error or not so anyone able to help would be great.
 

bsproul

New Member
Apr 25, 2018
1
1
toronto
Can anyone with a Model 3 confirm they are able to track their vehicle's live location while driving in the official Tesla app? Or if perhaps if there's a setting in the car that disables streaming? Try turning Summon off and try again, and the energy saver / always connected settings.

I'm seeing the official app set the initial position (from the drive state), but after sniffing traffic I'm seeing it fail to connect to the streaming endpoint with a "vehicle_disconnected" error. This is the exact same issue I've been seeing with Model 3s the past month in my own app I posted about earlier, trying to confirm this is a Tesla server-side error or not so anyone able to help would be great.

It tracks my car in the official app, but I'm guessing it polls the drive_state endpoint as it seems to update every ~5s.
 
  • Like
Reactions: SG57

SG57

Former Vendor
Jul 24, 2016
400
570
Spokane, WA
Anyone figured out the streaming API on the M3?
I've been debugging Model 3 streaming API for weeks now to no avail. After exhaustively snooping the official Tesla app and @bsproul 's account of ~5 second location updates (indicating drive state updates not streaming updates), I can only conclude streaming API is broken for Model 3s.

I'm seeing the exact same "vehicle_disconnected" results when using the official Tesla app as we see when connecting ourselves. Some times I have observed a "Vehicle is offline" value instead of the "vehicle_disconnected", but I've never received a success case on my own attempts or through using the official app only for Model 3.

I encourage all Model 3 owners to try out the official Tesla app and test if the Location screen is working as intended, meaning you get real-time updates including speed. Better yet if you're technically-minded try connecting to the streaming API yourself and witness successful data updates or failure due to "vehicle_disconnected".
 
  • Informative
Reactions: apacheguy

insaneoctane

Active Member
Apr 6, 2016
3,369
5,183
Southern California
Does the API support changing the charging start time? I can't find it, but it seems like a pretty fundamental need. If the answer is "no", then are all the apps that support changing the start time just manually starting the charge at the new time from the app/server end? Sounds crazy to me!
 

dpskipper

Developer
Aug 4, 2016
187
44
Australia
Does the API support changing the charging start time? I can't find it, but it seems like a pretty fundamental need. If the answer is "no", then are all the apps that support changing the start time just manually starting the charge at the new time from the app/server end? Sounds crazy to me!
That's how I do it...
It's the only workaround I've found.
 

About Us

Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.

Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


SUPPORT TMC
Top