-
-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
406 Error #594
Comments
It's not language specific at this point. We're seeing it in Python. The 406 is returning a 406: {"response":null,"error":"not_a_JSON_request","error_description":""} |
Thanks for confirming. There was an update to the Tesla App a few days ago ("Minor fixes and improvements"). Presumably the release note should have read "Update for changes to the API." |
It's not a public facing API. I doubt they'd mention it to the public. It'd be interesting to check to see if they've ever mentioned an API change publicly. |
I assume we missed a header |
Nope, I'm starting to receive 406 errors starting today and I checked my code and every web request do have Content-Type: application/json The authentication call proceeds successfully but the 'wake_up' call returns 406. If already awaken, I can retrieve the vehicle data but any commands to change something returns 406. So 'Get' commands work but Post commands returns 406. Edit: Scratch that. I had "HTTP_RESPONSE_CONTENT_TYPE_JSON" for response type (using Garmin API) but NOT for the request. Once I added ""Content-Type: application/json" to the Post header, it started to work again :-) |
It's not the
fixes the problem. D'oh! |
It was working before. Looks like Tesla is now more strict at what is passed in the header of a POST command. |
I am new to Tesla so not familiar with the history of Tesla API. Was Tesla using query params or form data instead of json body in the past? |
I'm also somewhat new to this. Started last fall. My app (on a Garmin watch) was working fine until today without the "Content-Type: application/json" in the POST Header. Now any POST commands fail without that line in the Header. |
It appears that since the API update, the application/json content header is required even for posts that don't include content (such as wake_up, charge_start and charge_stop). |
The Tesla API now complains if we don't set the Accept header.
can someone show how to add this fix to Python |
I fixed this at the client level for the next release. In the meantime, just use this to create your client: client = TeslaApi::Client.new(client_options: {headers: {"Accept" => "application/json"}}) |
Thanks @albahari. It's not relevant here but, what you said helped me fix my app on my Garmin watch (Monkey C). I added a dummy content (ie { "dummy" => "dummy" } to the MakeWebRequest calls that had an empty content and I can now control my car from my Garmin watch again :-) So it needed two fixes:
|
Very odd. For the past day or so, the Ruby client has been returning a 406 (Not Acceptable) error.
Worked fine before, so I'm not sure what changed. (This is with latest Git HEAD.)
The text was updated successfully, but these errors were encountered: