Migration to v1

Version v1.0.0 has some breaking changes which require client-side adaptations. This guide will list the changes made and give tips to adapt client apps.

Base API url

The API is now available at https://api.asi.swiss/api/v1/.

Note the trailing /v1/.

Paginated resources

The response of all resources listing endpoints is now paginated.

Concerned resources: Athlete, ManagerPermissions, Devices, JsonSchema, Activities, TimeFrames

Instead of a single JSON array in the body, response has the following pagination meta.

{ "count": 1234, "page": 1, "next": 2, "previous": null, "results": [ // a page of results ] }

You can change page with the page query parameter, for example page=2 fetch the second page.

By default, the page size is 150. You can change the page size with the limit query parameter, but a maximum of 500 items per page is tolerated.

Moreover, preprocessed data listing endpoint, which was already paginated, now use the same pagination meta as described above. Default (and maximum) page size is 10000.

Filtering resource

The following resources can be filtered with theses query parameters





Requesting device ownership

Requesting ownership of device is now done on ASI website at https://api.asi.swiss/device-activation/.

You need to be logged in as a manager user. Then fill the form as follow.

Then submit the form, and you will be redirected to a status page, showing if registration is successful or not.

An API endpoint can also be used to take ownership of a device: /take-ownership/.

The /own/ endpoint has been removed.

Device resource updates

WebSockets streaming of preprocessed data

Streaming preprocessed data of a device now require its id (integer), not the device_name.

For example: wss://api.asi.swiss/api/ws/preprocessed-data/1/