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

Tesla Owners API v3 enabled

This site may earn commission on affiliate links.
Tesla broke their API with new auth v3, so I had to make a code update again.
The code does not work with 2FA or Multi Factor Auth, I don't recommend it, on powerwall management, cause those tokens can expire.

we use this code to maange charge and discharge times for time of use to lower demand charges

See latest code here:
fkhera/powerwallCloud

(This code is used for managing peak off peak usage for the Tesla Powerwall more so cause SRP has a double peak 5am-9am, and 5pm-9pm)

Good luck Tesla fans!
 
  • Helpful
Reactions: willow_hiller
I can't even get into the Telsa owners' login normally. I am seeing some outage reports as well. Just a heads up not to spin your wheels too much because it looks like they broke more than one thing today.

FYI , mine works as of 3 hours ago, at least our powerwall sent successful commands.
Likely you are running into the new AUTH problem, which requires a bit of a process to get a token:

Its a pretty lengthy process that is easily coded but the docs are here now:
Authentication
 
I'm using 2FA so I guess I am hosed for a little while until they fix it.

upload_2021-2-1_11-18-37.png
 
Tesla has deprecated the /oauth/token endpoint in favor of using auth.tesla.com. I'm working on updating the documentation as soon as possible. This documentation is still missing handling for MFA users. Feel free to discuss this in issue #260.

Tesla uses a separate SSO service (auth.tesla.com) for authentication across their app and website. This service is designed around a browser-based flow using OAuth 2.0, but also appears to have support for Open ID Connect. This supports both obtaining an access token and refreshing it as it expires.

 
FYI , mine works as of 3 hours ago, at least our powerwall sent successful commands.
Likely you are running into the new AUTH problem, which requires a bit of a process to get a token:

Its a pretty lengthy process that is easily coded but the docs are here now:
Authentication


I'm not even trying to talk with the API. Tesla's own website isn't working. I havent tried playing with the API with postman today.
 
Tesla SSO – Login

This portal allowed me to login, I just went to Tesla.com, clicked my account on top right.
This is the v3 api, auth.tesla.com so just confirm thats where you are being taken.

Does the link above work okay?


Oh I understand, I was bummed to see your post. I don't do much with the API, but its fun to play around with. I just tried going into it and it finally let me in. Teslafi seems still still work, but the token probably doesn't expire for a while.

And the link above was what I was trying to use. They are having some issues...
 
Oh I understand, I was bummed to see your post. I don't do much with the API, but its fun to play around with. I just tried going into it and it finally let me in. Teslafi seems still still work, but the token probably doesn't expire for a while.

And the link above was what I was trying to use. They are having some issues...

TeslaFI is a pretty main stream app, I would imagine they have already switched to auth.tesla.com and using V3.
You could opt into it for quite some time, but I posted this cause Friday, they forced Tesla owner API tokens to come from another source.

The process in a nutshell now is:
You login to auth.tesla.com site and you get some token from their SSO servers.
You use that token, using a new defined auth type in the Owners API called:

```

{
"grant_type": "urn:ietf:params:eek:auth:grant-type:jwt-bearer",
"client_id": "abc",
"client_secret": "123"
}
```

Where as before you might have used some type of password grant.
So now everybody who relied on Tesla Owners API, now needs to go through the process outlined in the doc, get a token, exchange for Owners API token, and then they can manage refresh.
If you using MFA thats another wrinkle, so then you manage refresh tokens.
 
  • Helpful
Reactions: Kodemonkey