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

Model 3 App and API

This site may earn commission on affiliate links.
Just got my car yesterday (M3) and I can't seem to get the API access to work. I was able to get a token using either a curl command or python script but when I try any of the other commands (e.g. vehicles) I get an "invalid token" error. Tried resetting my password and generated a new token but still no luck. I get the same error whether I go straight from the Tim Dorr site or via curl or python. Anyone else been able to get results with a new M3?
My API calls have been working since I started. My key learning was using the right CarID from the listAllVehicles command. My earliest successful command was at mile 32.793488 on my odometer (from the API result). This video helped explain everything...
 
In the API documentation, it says that the ListVehicles call will list vehicles associated with the account, that have not shipped yet! However -- I haven't heard of a case of that working on (on Model 3's at least) -- and most people report that the phone app doesn't show their vehicle associated with the account until right before delivery. It seems odd, since they even have a way of controlling/reporting "MobileAccess" state -- I would think it could show the vehicle, and simply have mobile access denied until delivery -- but that doesn't *seem* to be the case.
 
First post in the Model 3 community. I'm looking for an owner of a Model 3 who'd be willing to help me document the Model 3 specific APIs. Once documented developers will be able to add functionality to their apps, voice assistant skills and sites. Right now these APIs are undocumented and are waiting with someone with a Model 3 and the know-how to document them.

Anyone with a Model 3 willing to help?

Here's a GitHub issue by the dev that maintains the current API documentation.
Model 3 APIs · Issue #52 · timdorr/model-s-api · GitHub

Feel free to PM if you'd rather have the conversation there.

Erik,

I couldn't figure out how to PM you here, but I am interested in working on the Model 3 API. I have a Model 3 to test with!
 
I wrote a couple of things using the APIs. More details below, and the code is open sourced.
  1. One is a Windows based token generator - read up more here.
  2. Model 3 "Keyfob" - using a IoT button and turning that into a 'keyfob' for the model 3. Read up more here on that.
Now trying to figure out the Streaming API - that doesn't seem to work on Model 3, but what is that providing. Been noodling on building a data logger app of sorts for myself and I wonder if that is something I would use for this.
 
  • Like
Reactions: Dreadnought
I wrote a couple of things using the APIs. More details below, and the code is open sourced.
  1. One is a Windows based token generator - read up more here.
  2. Model 3 "Keyfob" - using a IoT button and turning that into a 'keyfob' for the model 3. Read up more here on that.
Now trying to figure out the Streaming API - that doesn't seem to work on Model 3, but what is that providing. Been noodling on building a data logger app of sorts for myself and I wonder if that is something I would use for this.

I wrote a python script and used amazon-dash to get an amazon dash button to unlock the door. One problem I have is that if the M3 is asleep it won't unlock on the first command. I basically have to wake the car and then wait 15 seconds before sending the unlock command. Is this your experience as well?
 
@gadgetware , I imagine it's normal to have to wake the car up or otherwise having systems up and chatting with servers would exacerbate vampire drain, no ?

@Xtek , happy to help if you need a p3d owner to help iron some stuff out. On a related note, I've been wondering if there's an API call for homelink to trigger the garage door, it'd be great to be able to trigger remotely (when access to garage is only through garage door for example - avoid lugging around a clunky remote)