Sponsored

Rivian API

AdamUCF

Well-Known Member
First Name
Adam
Joined
Apr 3, 2022
Threads
13
Messages
299
Reaction score
434
Location
Orlando, FL
Vehicles
June 2022 R1T
I threw together a script (PowerShell since I'm a Windows guy but should work on Linux/Mac if you're into that sorta thing) that checks your order and guide status every 5 minutes and will let you know if it changes. Yes, very excessive but apparently I have nothing better to do with my time. I'll give a nod to @p3ck over here for the idea (and I put it on GitHub @AllInev).

Save/download this as Check-RivianOrder.ps1. Edit to fill in your user/password at the top. If you want immediate notification to your phone you can use a twilio account (they have a free trial) to get notified. Run it and it will check status every 5 minutes. It should be light enough so that even if a ton of people were to run it, it won't even be a blip on Rivian's radar. I'd be curious for someone who has a guide to run it and validate that it just returns to double check my work (though I'm pretty sure this will function how I assume).

Sponsored

 

p3ck

Well-Known Member
First Name
Bill
Joined
May 3, 2021
Threads
6
Messages
198
Reaction score
289
Location
Massachusettes, USA
Vehicles
Rivian R1T
Occupation
Software Engineer
Clubs
 
I threw together a script (PowerShell since I'm a Windows guy but should work on Linux/Mac if you're into that sorta thing) that checks your order and guide status every 5 minutes and will let you know if it changes. Yes, very excessive but apparently I have nothing better to do with my time. I'll give a nod to @p3ck over here for the idea (and I put it on GitHub @AllInev).

Save/download this as Check-RivianOrder.ps1. Edit to fill in your user/password at the top. If you want immediate notification to your phone you can use a twilio account (they have a free trial) to get notified. Run it and it will check status every 5 minutes. It should be light enough so that even if a ton of people were to run it, it won't even be a blip on Rivian's radar. I'd be curious for someone who has a guide to run it and validate that it just returns to double check my work (though I'm pretty sure this will function how I assume).

Hmmm.. This isn't working for me.

Code:
$ pwsh Check-RivianOrder.ps1
Check #1. 05/08/2022 12:35:24                                                                 
orders is empty :(
Invoke-RestMethod: /home/bpeck/Check-RivianOrder.ps1:55
Line |
  55 |  … guideResp = Invoke-RestMethod "https://rivian.com/api/gql/business" - …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | {"errors":[{"message":"User not
     | authenticated","extensions":{"code":"UNAUTHENTICATED"}}]}

no guide :(
I also had to comment out the [console]::beep(1000,500) since they are not available on the linux platform.

Could it be an issue with the mobile client id and secret?
 

pc500

Well-Known Member
Joined
Jun 22, 2021
Threads
18
Messages
1,017
Reaction score
549
Location
US
Vehicles
dodge ram
Yeah it's a standard REST end points, so should not be that complicated. Unfortunately I do not have a vehicle yet but I did ask Rivian about API availability and they have ignored those emails, I even asked them on linkedin lol

I really want to be able to dig into the vehicle/API for accessibility reasons
You really don't need a vehicle for a lot of it. Get the app setup, disable certificate pinning, and poke around. You can at least get logged in and play a bit.

Some stuff will obviously only be possible with a vehicle, but you can do what the app can do.
 

AdamUCF

Well-Known Member
First Name
Adam
Joined
Apr 3, 2022
Threads
13
Messages
299
Reaction score
434
Location
Orlando, FL
Vehicles
June 2022 R1T
Hmmm.. This isn't working for me.

Code:
$ pwsh Check-RivianOrder.ps1
Check #1. 05/08/2022 12:35:24                                                                
orders is empty :(
Invoke-RestMethod: /home/bpeck/Check-RivianOrder.ps1:55
Line |
  55 |  … guideResp = Invoke-RestMethod "https://rivian.com/api/gql/business" - …
     |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | {"errors":[{"message":"User not
     | authenticated","extensions":{"code":"UNAUTHENTICATED"}}]}

no guide :(
I also had to comment out the [console]::beep(1000,500) since they are not available on the linux platform.

Could it be an issue with the mobile client id and secret?
I updated the script and it should work now. I probably should've tested before saying it would work. It wasn't an inherent flaw in the auth but a dumb PowerShell idiosyncrasy causing the issue.
 

AdamUCF

Well-Known Member
First Name
Adam
Joined
Apr 3, 2022
Threads
13
Messages
299
Reaction score
434
Location
Orlando, FL
Vehicles
June 2022 R1T
You really don't need a vehicle for a lot of it. Get the app setup, disable certificate pinning, and poke around. You can at least get logged in and play a bit.

Some stuff will obviously only be possible with a vehicle, but you can do what the app can do.
Disabling the cert pinning was tricky. Not something I've done a whole bunch and maybe there's an easier way but had to patch the Android apk.
 

Sponsored

pc500

Well-Known Member
Joined
Jun 22, 2021
Threads
18
Messages
1,017
Reaction score
549
Location
US
Vehicles
dodge ram
Disabling the cert pinning was tricky. Not something I've done a whole bunch and maybe there's an easier way but had to patch the Android apk.
No easy way. Alternative is a rooted phone with modified SSL libraries.

Hopefully they just release a "unlocked" APK like Facebook does to just remove all the hassle... Let me know when you have it documented :)
 

p3ck

Well-Known Member
First Name
Bill
Joined
May 3, 2021
Threads
6
Messages
198
Reaction score
289
Location
Massachusettes, USA
Vehicles
Rivian R1T
Occupation
Software Engineer
Clubs
 
I updated the script and it should work now. I probably should've tested before saying it would work. It wasn't an inherent flaw in the auth but a dumb PowerShell idiosyncrasy causing the issue.
Did you update the gist? I pulled it again and it doesn't look changed. :)
 

p3ck

Well-Known Member
First Name
Bill
Joined
May 3, 2021
Threads
6
Messages
198
Reaction score
289
Location
Massachusettes, USA
Vehicles
Rivian R1T
Occupation
Software Engineer
Clubs
 
Did you update the gist? I pulled it again and it doesn't look changed. :)
Nevermind.. I see it now. :) Not sure how I missed it.
 

Mysta

Well-Known Member
First Name
Matt
Joined
Jan 30, 2021
Threads
8
Messages
482
Reaction score
553
Location
SC
Vehicles
Taycan 4S, Polestar 2, Miata ND2 RF
I threw together a script (PowerShell since I'm a Windows guy but should work on Linux/Mac if you're into that sorta thing) that checks your order and guide status every 5 minutes and will let you know if it changes. Yes, very excessive but apparently I have nothing better to do with my time. I'll give a nod to @p3ck over here for the idea (and I put it on GitHub @AllInev).

Save/download this as Check-RivianOrder.ps1. Edit to fill in your user/password at the top. If you want immediate notification to your phone you can use a twilio account (they have a free trial) to get notified. Run it and it will check status every 5 minutes. It should be light enough so that even if a ton of people were to run it, it won't even be a blip on Rivian's radar. I'd be curious for someone who has a guide to run it and validate that it just returns to double check my work (though I'm pretty sure this will function how I assume).

Random note - does work show when guide is assigned correctly.
 

boardthatpowder

Well-Known Member
First Name
Dean
Joined
Sep 10, 2021
Threads
5
Messages
137
Reaction score
143
Location
CO
Vehicles
Rivian R1T, Audi Q5
Thanks to @AdamUCF for the reverse engineering to create the PowerShell script. I've ported it over to Python to be compatible with more architectures including Mac and Linux.

 

Sponsored

kanundrum

Well-Known Member
Joined
May 2, 2020
Threads
217
Messages
3,976
Reaction score
12,107
Location
Washington, DC
Vehicles
Giulia QV, R1S (S00N)
Occupation
IT
Clubs
 

pc500

Well-Known Member
Joined
Jun 22, 2021
Threads
18
Messages
1,017
Reaction score
549
Location
US
Vehicles
dodge ram
Nice. That's much better than reverse engineering the thing from the APK
 

kanundrum

Well-Known Member
Joined
May 2, 2020
Threads
217
Messages
3,976
Reaction score
12,107
Location
Washington, DC
Vehicles
Giulia QV, R1S (S00N)
Occupation
IT
Clubs
 
Nice. That's much better than reverse engineering the thing from the APK

Its actually all within the APK it self as well + a LOT more services such cloud uploader etc.
 

pc500

Well-Known Member
Joined
Jun 22, 2021
Threads
18
Messages
1,017
Reaction score
549
Location
US
Vehicles
dodge ram
I actually didn't assume it would be there in the clear like that. I was just man in the Middling the app API calls.

Life's good.
 

GoWest!

Well-Known Member
Joined
Oct 11, 2019
Threads
6
Messages
123
Reaction score
210
Location
Pacific NW
Vehicles
Subaru Outback & R1S
I can’t be the only non-tech person thinking this: “what?” This seems important but I have no clue what you all are talking about.

Non-tech language please…and thank you. 🙂
Sponsored

 
 




Top