Closed benhannel closed 6 years ago
Could you submit a PR with changes?
In the vehicles list API there is a vehicle_id
param and an id
/id_s
param and they are different values. Does anyone know what the difference is?
The vehicle_id
is a GUID of some sort for the vehicle. There are a few different APIs (info/command JSON API, the streaming telematics, the autopark system), so it's used as a unique identifier for the vehicle everywhere. It may come from some internal ERP system.
The id
is because the JSON API runs on a Rails application. Rails' ORM (ActiveRecord) always adds an auto-incrementing id
field to every model. It also makes it easy to look up a model by this id (Vehicle.find(params[:id])
), so it's passed around as a convenience.
When you need to hop systems, the vehicle_id
is used. When you are sticking to just the JSON API, then you can use id
.
Great info. Thanks!
I agree there are a few starved areas that could be improved in the api. I have not written any down yet, but from what I remember:
I'll open an issue for these
Finally added a blurb on this! https://tesla-api.timdorr.com/api-basics/vehicles
I'm cleaning up the other usages as I go too.
In the apiary documentation, almost all the methods require a "vehicle_id" parameter, however it actually seems this must be the value labeled "id" in the list of all vehicles.