Best Practices
Reuse Access Tokens
Bearer tokens fetched from the token endpoint are valid for 60 minutes. It is recommended to store the token and reuse it for as long as it is valid.
Use a Version Header
Use a version header to target a specific API version in production scenarios. See more details on Versioning.
Use specific values in query parameters
The api often allows one to use default values for query parameters. This is convenient when exploring the API using command line tools because it shortens the requests. However, this can lead to responses being dependent on the time when a query is run (e.g. querying the last hour of data returns different results when run at different points in time). It therefore advised to explicitely set query parameters whenever possible.
Avoid Concurrent Requests
It is recommended to avoid making a large number of concurrent requests, and instead spread requests evenly over time.
Fewer, but Larger Requests
The API is designed to be flexible and supports handling a lot of different use cases in a single request. If possible, chose fewer but larger requests over many small requests.
Request Only Required Data
Request data only for required tags and vessels. Especially requests to the measurements endpoint can result in transfer of a large amount of data.
Using the POST method on the measurements endpoint allows to cherry-pick required tags. This results in less data transferred than using the GET method with the * wildcard at the tag level.
Examples on how to use the POST method can be found here: POST /measurements.
Last updated