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

Tesla Owner API Tutorial (All you need is your browser)

Indeed :) I am going tomorrow for my 2nd "uncorking" this time I will be prepared :)

At least you'll be able to tell, and verify right away, probably while you're tapping feverishly on your phone as they're bringing your car back to you.

I still can't get into the API-Apiary-thing. My appointment is next Tuesday the 7th. The only way I'll know, maybe, is when I first mash it.
 

phaduman

Member
Supporting Member
Sep 16, 2016
386
570
San Jose
Hi Akrion, great video and explanation, thanks!

Quick (perhaps dumb Q) security Q: As we are pasting the password on the browser page that is hosted in the cloud/apiary, wouldn't there be a possibility that apiary/another host is perhaps logging the information?

@Akrion , can you please answer my Q above? I would want to follow this, but curious about any logging at the Apiary hosting site that may be keeping my token stored...while I can always change the token after testing, I would prefer to use this API in the future without worrying about security. Thanks.
 

Akrion

Member
Aug 16, 2017
56
78
CA
@Akrion , can you please answer my Q above? I would want to follow this, but curious about any logging at the Apiary hosting site that may be keeping my token stored...while I can always change the token after testing, I would prefer to use this API in the future without worrying about security. Thanks.

OK so Apiary is now officially owned by ORACLE ... which should give you some confidence (Or not depending on which side of Oracle fan club you are :)). But as a general practice you should change your passwords often and use a password manager to take care of the "I forgot" factor. I personally trust Apiary and use them at work etc. It would not be very wise on their end to store all API calls since that would make them liable I would imagine.

In any case what I do is when I am done with using any service like that (which I have some concerns) I change the password and my password manager takes care of the storing/remembering part :). For the purpose of the video I used a temp password did the video and after that changed it. Verified all apps etc did not work with the old one and started using the new one.

Hope this helps.
 
  • Love
Reactions: phaduman

Jonas_man

Member
Sep 1, 2015
278
129
Helsinki
As of right now, ONLY 75Ds can be "uncorked".

P1 for a 90D just means that you already have the higher performance torque curve/1300A limit for the smaller dual motors (the same that would apply to an uncorked 75D) applied to your car... So, essentially, yes, means you are "uncorked".

Yeah, makes sense.
I was just hoping for the same speed as the 100D . from 4.4 to 4.3s 0-100km/h
 

ccdisce

EBISU like
Sep 10, 2014
234
118
Georgia USA
I searched through the threads here but all I was able to find was a little bit too technical IMO for the average user and the step by step how to was not really there. I love the fact that Tim did the Apiary.io documentation and wanted with just the browser to walk through an example of how to get your Tesla's vehicle state etc.

I ended up actually doing this step by step for myself and that is how I found out that my "uncorking" was not done although my car was 2 months ago with Tesla of West Palm Beach for that exact purpose. So I have a real life example how this helped me.

Obviously, you can go like 10 different ways to get to the API and work with it but what I really liked with the Apiary.io was that all you need is just the browser so anyone can quickly do it without any other tools like Postman etc.

In any case, hope this is useful to the community and my apologies if it was done already. I did not find much on YT on the subject.



PS. There are few issues in the video like the Content-Type header param etc but overall it should suffice for the average user to follow and get data for their vehicle out IMO.


Akrion, Thanks for making this video available to us SW disinclined folk..... speaking for myself only, but it seems as if I will be pulled in.

I have taken the liberty to generate a 'crib sheet' in case I need to use it again into the future.


1. AUTHENTICATION
=================
a.Switch to Console
b.For Body
--------copy and paste the following into Body
{
"grant_type": "password",
"client_id": "81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384",
"client_secret": "c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3",
"email": "your e-mail addy",
"password": "my-tesla password"
}
c. Headers
---------- may have to type it in in the required field.... oh horrors
click on '+' to Add new header
fill out highlighted block with "Content-Type" and "application/json" in the highlighted 'null'
d.Click 'Call Resource' check response for 200 status is good.

2. List all Vehicles
====================
a. Body
leave blank
b. Headers
" Authorization" already preset Bearer <{token pasted here}> make sure you copy it all
c.URI Parameters
not required
d. Click 'Call Resource' check response for 200 status is good.

3. Vehicle State
=================
a. Body
leave blank
b. Headers
Authorization already preset Bearer <{token pasted here}>
c. URI Parameters
vehicle_id <paste 'id_s' numeric string >

d. Click 'Call Resource' check response for 200 status is good.



==================
Kudos to Akrion===
=================
 

ccdisce

EBISU like
Sep 10, 2014
234
118
Georgia USA
I just checked my 2017 S75 I have nothing that says "perf_config" at all

17 “odometer”
18 “parsed_calandar_supportedl
19 “pf”
20 “pr”
21 “remote_start”


Do not know why your Vehicle State does not show perf_config, my jul2017 build 100D running 8.1 2017.42 a88c8d5 looks like;

Vehicle State
------------------------------------------------
BODY
------------------------------------------------

{
"response": {
"api_version": 3,
"autopark_state": "unavailable",
"autopark_state_v2": "disabled",
"autopark_style": "dead_man",
"calendar_supported": true,
"car_type": "models2",
"car_version": "2017.42 a88c8d5",
"center_display_state": 0,
"dark_rims": false,
"df": 0,
"dr": 0,
"exterior_color": "SignatureBlue",
"ft": 0,
"has_spoiler": false,
"homelink_nearby": false,
"last_autopark_error": "no_error",
"locked": true,
"notifications_supported": true,
"odometer": 1611.766113,
"parsed_calendar_supported": true,
"perf_config": "P1",
"pf": 0,
"pr": 0,
"rear_seat_heaters": 0,
"rear_seat_type": 0,
"remote_start": false,
"remote_start_supported": true,
"rhd": false,
"roof_color": "Glass",
"rt": 0,
"seat_type": 2,
"spoiler_type": "None",
"sun_roof_installed": 0,
"sun_roof_percent_open": 0,
"sun_roof_state": "unknown",
"third_row_seats": "None",
"timestamp": 1511219939873,
"valet_mode": false,
"valet_pin_needed": true,
"vehicle_name": "Elon's pet Demon",
"wheel_type": "AeroTurbine19"
}
}

cut/paste does not seem to bring the line numbers.

you may want to try it again.
 

appleguru

Active Member
Mar 15, 2017
1,025
1,852
MA, US
I just checked my 2017 S75 I have nothing that says "perf_config" at all

17 “odometer”
18 “parsed_calandar_supportedl
19 “pf”
20 “pr”
21 “remote_start”

Perhaps the latest firmware no longer supports sharing perf_config over the API? I no longer see it either:

Code:
{
  "response": {
    "api_version": 3,
    "autopark_state": "ready",
    "autopark_state_v2": "ready",
    "autopark_style": "standard",
    "calendar_supported": true,
    "car_version": "2017.46 3387a54",
    "center_display_state": 0,
    "df": 0,
    "dr": 0,
    "ft": 0,
    "homelink_nearby": false,
    "last_autopark_error": "no_error",
    "locked": true,
    "notifications_supported": true,
    "odometer": XXXXX,
    "parsed_calendar_supported": true,
    "pf": 0,
    "pr": 0,
    "remote_start": false,
    "remote_start_supported": true,
    "rt": 0,
    "sun_roof_percent_open": 0,
    "sun_roof_state": "unknown",
    "timestamp": 1511200000000,
    "valet_mode": false,
    "vehicle_name": "XXXXX"
  }
}
 
Last edited:

appleguru

Active Member
Mar 15, 2017
1,025
1,852
MA, US
Do not know why your Vehicle State does not show perf_config, my jul2017 build 100D running 8.1 2017.42 a88c8d5 looks like;

Vehicle State
------------------------------------------------
BODY
------------------------------------------------

{
"response": {
"api_version": 3,
"autopark_state": "unavailable",
"autopark_state_v2": "disabled",
"autopark_style": "dead_man",
"calendar_supported": true,
"car_type": "models2",
"car_version": "2017.42 a88c8d5",
"center_display_state": 0,
"dark_rims": false,
"df": 0,
"dr": 0,
"exterior_color": "SignatureBlue",
"ft": 0,
"has_spoiler": false,
"homelink_nearby": false,
"last_autopark_error": "no_error",
"locked": true,
"notifications_supported": true,
"odometer": 1611.766113,
"parsed_calendar_supported": true,
"perf_config": "P1",
"pf": 0,
"pr": 0,
"rear_seat_heaters": 0,
"rear_seat_type": 0,
"remote_start": false,
"remote_start_supported": true,
"rhd": false,
"roof_color": "Glass",
"rt": 0,
"seat_type": 2,
"spoiler_type": "None",
"sun_roof_installed": 0,
"sun_roof_percent_open": 0,
"sun_roof_state": "unknown",
"third_row_seats": "None",
"timestamp": 1511219939873,
"valet_mode": false,
"valet_pin_needed": true,
"vehicle_name": "Elon's pet Demon",
"wheel_type": "AeroTurbine19"
}
}

cut/paste does not seem to bring the line numbers.

you may want to try it again.
I suspect tesla may have removed this property from the API because owners were bugging them about uncorking not being done correctly too much (Which, while I can understand, is terrible if true!)
 
Last edited:
Maybe they removed it same as yesterday

"response": {

"api_version": 3,

"autopark_state": "unavailable",

"autopark_state_v2": "standby",

"autopark_style": "dead_man",

"calendar_supported": true,

"car_version": "2017.46 3387a54",

"center_display_state": 0,

"df": 0,

"dr": 0,

"ft": 0,

"homelink_nearby": true,

"last_autopark_error": "no_error",

"locked": true,

"notifications_supported": true,

"odometer": 744.480613,

"parsed_calendar_supported": true,

"pf": 0,

"pr": 0,

"remote_start": false,

"remote_start_supported": true,

"rt": 0,

"sun_roof_percent_open": 0,

"sun_roof_state": "unknown",

"timestamp": 1511273065853,

"valet_mode": false,

"valet_pin_needed": true,

"vehicle_name": ""
 
yup I just checked and no more perf config in the response =( =( thats messed up.

{
"response": {
"api_version": 3,
"autopark_state": "standby",
"autopark_state_v2": "standby",
"autopark_style": "standard",
"calendar_supported": true,
"car_version": "2017.46 3387a54",
"center_display_state": 0,
"df": 0,
"dr": 0,
"ft": 0,
"homelink_nearby": false,
"last_autopark_error": "no_error",
"locked": true,
"notifications_supported": true,
"odometer": 5234.345385,
"parsed_calendar_supported": true,
"pf": 0,
"pr": 0,
"remote_start": false,
"remote_start_supported": true,
"rt": 0,
"sun_roof_percent_open": 0,
"sun_roof_state": "unknown",
"timestamp": 1511316118205,
"valet_mode": false,
"valet_pin_needed": true,
 

appleguru

Active Member
Mar 15, 2017
1,025
1,852
MA, US
I have a model s 75 refresh NON D and I have P1 as my "perf_config"

It was bought end of 2016 and I dont think they are even offering uncorking for this car.
Thoughts?

The flag doesn’t really have anything to do with uncorking directly; has more to do with the firmware and power/torque curve that gets loaded on to your car...

It is only really an indicator of uncorking status on a 75D vehicle.

Can you share your API response though? What fw version are you running?
 
  • Informative
Reactions: BigTonyTones
The flag doesn’t really have anything to do with uncorking directly; has more to do with the firmware and power/torque curve that gets loaded on to your car...

It is only really an indicator of uncorking status on a 75D vehicle.

Can you share your API response though? What fw version are you running?
Confirmed that this is removed from the latest firmwares. I took my car in for uncorking and literally watched it happen. I kept a PowerShell script queued up on my phone via RDP to query the status of my car as they were working on it. They uncorked it first, which my script confirmed, and then they updated me from 42 to 46.8 at which point my script stopped working. I don't suppose anyone found a new location in the API response for this same info?
 

Akrion

Member
Aug 16, 2017
56
78
CA
Confirmed that this is removed from the latest firmwares. I took my car in for uncorking and literally watched it happen. I kept a PowerShell script queued up on my phone via RDP to query the status of my car as they were working on it. They uncorked it first, which my script confirmed, and then they updated me from 42 to 46.8 at which point my script stopped working. I don't suppose anyone found a new location in the API response for this same info?

Not sure I agree with you. Postman tells a different story for me ... "perf_config": "P1" is def. there

PS. I did re-authenticate etc.
 

Products we're discussing on TMC...

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