You can upgrade the API token version in your admin console. Samsara only increments the API version when there is a breaking change to the API.
Examples of breaking changes include:
- Adding a mandatory request parameter to existing API methods
- Removing properties from existing API responses
For non-breaking changes, these will be accessible across all versions of the API. Examples of these include:
- Adding new API resources
- Adding new optional request parameters to existing API methods
- Adding new properties to existing API responses
- Changing the order of properties in existing API responses
- Changing the length or format of object IDs or other opaque strings
How to upgrade your API version
You can find the version on the API Tokens page in the dashboard:
Upgrading your API version will affect the API calls you make without a Samsara-Version header: the parameters you can send and the structure of objects returned.
You can test a newer version for an API call by setting the Samsara-Version header. In the example code below,
Once you are confident y our code can handle the latest version, click on the "Upgrade" button in your Dashboard. This switches the version used by API calls with no Samsara-Version header.
To stay up-to-date on the latest API updates, check out the API Release Notes.