Add support for vehicle_location Fleet API scope#184
Merged
Conversation
Tesla recently started requiring the `vehicle_location` scope for the `/vehicle_data` endpoint. Without this scope, calls like `getAllData(vehicle)` fail with HTTP 403 (Forbidden). This PR adds `.vehicleLocation = "vehicle_location"` to the `TeslaAPI.Scope` enum so developers can request the proper scope when initializing the Fleet API client.
Patch Add support for `vehicle_location` Fleet API scope
Owner
|
Thanks. I was under the impression that this was already added for some reason |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tesla’s Fleet API now requires the vehicle_location scope for vehicle data requests such as getAllData(vehicle).
Without this scope, calls to /vehicle_data can fail with 403 Forbidden, even when the client is otherwise authenticated correctly.
This change:
• adds case vehicleLocation = "vehicle_location" to TeslaAPI.Scope
• includes .vehicleLocation in TeslaAPI.Scope.all
This keeps the default Fleet API scope set aligned with current Tesla requirements and prevents missing-scope failures for apps using getAllData(...).
Why
Apps using TeslaSwift with the Fleet API can otherwise hit authorization errors when requesting vehicle data, especially location-related fields included in /vehicle_data.
Change summary
• Sources/TeslaSwift/TeslaSwift.swift
• add vehicleLocation scope
• include it in Scope.all