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

Error in Tesla API

This site may earn commission on affiliate links.
Hi,

Today I noticed that when I use the unofficial tesla API. I get a response like this on vehicle commands:

<html><head></head><body><p>Our servers are waiting for a supercharger spot..</p></body></html>

The same call worked yesterday. Doe anybody know what this message means?
Vehicle state commands are still working.
The original Tesla app is still working correct.

What I also tried was using:

Tesla Model S JSON API · Apiary

filled in my vehicle id and bearer token and I get above response. When I use the 'Mock server' I get the correct response
 
I ran into this issue as well and I added two new headers:

User-Agent: Mozilla/5.0 (Linux; Android 9.0.0; VS985 4G Build/LRX21Y; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36

X-Tesla-User-Agent: TeslaApp/3.4.4-350/fad4a582e/android/9.0.0

These work and are based on the latest app i've installed. But I'm pretty sure the x-tesla-user-agent could be anything.
 
Thanks morder,

I am going for a different approach to get these headers, for future changes. I will try to run a proxy and create signed certificates with my own CA (for the tesla api url). And via DNS redirect traffic to my proxy. I then only need to install my own CA on my own phone. If this works I can log all headers easily.

Ronald
 
In my case, I simply had to add 'user-agent' header to my node client with an arbitrary value. Strangely, postman, curl, ruby, etc. all worked, but there's something weird about node. Anyway, no time to figure it out, here's some copy pasta that you can try

Code:
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "owner-api.teslamotors.com",
  "port": null,
  "path": "/api/1/vehicles",
  "headers": {
    "authorization": "Bearer YOUR_TOKEN_HERE",
    'user-agent': '007'
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
 
  • Funny
Reactions: brianman