TMC is an independent, primarily volunteer organization that relies on ad revenue to cover its operating costs. Please consider whitelisting TMC on your ad blocker and becoming a Supporting Member. For more info: Support TMC

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

Discussion in 'Model S' started by Akrion, Oct 27, 2017.

  1. Akrion

    Akrion Member

    Joined:
    Aug 16, 2017
    Messages:
    52
    Location:
    Flroida
    Indeed :) I am going tomorrow for my 2nd "uncorking" this time I will be prepared :)
     
    • Like x 2
  2. avesraggiana

    avesraggiana Member

    Joined:
    Jan 25, 2017
    Messages:
    375
    Location:
    Chula Vista CA
    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.
     
  3. phaduman

    phaduman Supporting Member

    Joined:
    Sep 16, 2016
    Messages:
    367
    Location:
    San Jose
    @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.
     
  4. Akrion

    Akrion Member

    Joined:
    Aug 16, 2017
    Messages:
    52
    Location:
    Flroida
    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 x 1
  5. Akrion

    Akrion Member

    Joined:
    Aug 16, 2017
    Messages:
    52
    Location:
    Flroida
    Just used the API to check ... and we have "perf_config": "P1"

    Now lets see when I get the keys if that config remains and if so ... time to play :)
     
    • Like x 2
  6. Jonas_man

    Jonas_man Member

    Joined:
    Sep 1, 2015
    Messages:
    268
    Location:
    Helsinki
    Yeah, makes sense.
    I was just hoping for the same speed as the 100D . from 4.4 to 4.3s 0-100km/h
     
  7. ccdisce

    ccdisce Member

    Joined:
    Sep 10, 2014
    Messages:
    163
    Location:
    Georgia USA

    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===
    =================
     
    • Like x 4
  8. Tdreamer

    Tdreamer Supporting Member

    Joined:
    Sep 10, 2017
    Messages:
    197
    Location:
    Bedford, Massachusetts
    Great stuff. Thanks for sharing
     
  9. Barryabrams

    Barryabrams Member

    Joined:
    Apr 19, 2014
    Messages:
    5
    Location:
    Fortlauderdale
    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”
     
  10. ccdisce

    ccdisce Member

    Joined:
    Sep 10, 2014
    Messages:
    163
    Location:
    Georgia USA

    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.
     
  11. appleguru

    appleguru Member

    Joined:
    Mar 15, 2017
    Messages:
    635
    Location:
    US
    #71 appleguru, Nov 20, 2017
    Last edited: Nov 20, 2017
    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"
      }
    }
     
  12. appleguru

    appleguru Member

    Joined:
    Mar 15, 2017
    Messages:
    635
    Location:
    US
    #72 appleguru, Nov 20, 2017
    Last edited: Nov 20, 2017
    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!)
     
  13. Barryabrams

    Barryabrams Member

    Joined:
    Apr 19, 2014
    Messages:
    5
    Location:
    Fortlauderdale
    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": ""
     
  14. rbtower2

    rbtower2 Member

    Joined:
    Nov 5, 2017
    Messages:
    9
    Location:
    Virginia
    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,
     
  15. appleguru

    appleguru Member

    Joined:
    Mar 15, 2017
    Messages:
    635
    Location:
    US
    Can anyone not on .46 reply with their api response?
     
  16. BigTonyTones

    BigTonyTones Member

    Joined:
    Nov 28, 2016
    Messages:
    385
    Location:
    Los Angeles
    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?
     
  17. appleguru

    appleguru Member

    Joined:
    Mar 15, 2017
    Messages:
    635
    Location:
    US
    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 x 1
  18. Byshop303

    Byshop303 Member

    Joined:
    Feb 3, 2017
    Messages:
    29
    Location:
    Colorado, USA
    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?
     
  19. Akrion

    Akrion Member

    Joined:
    Aug 16, 2017
    Messages:
    52
    Location:
    Flroida
    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.
     
  20. Akrion

    Akrion Member

    Joined:
    Aug 16, 2017
    Messages:
    52
    Location:
    Flroida
    Wait ... I spoke too soon ... my car version is 2017.42 so you still might be right ... I guess I would know in the next update :|
     

Share This Page

  • 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