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.
The API is now available at https://api.asi.swiss/api/v1/.
Note the trailing /v1/
.
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
]
}
count
gives you the total number of results for your querypage
gives you the current page numbernext
gives you the next page number, or null
if there is no remaining pageprevious
gives you the previous page number, or null
if there is no previous pageresults
contains the array of results for this pageYou 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.
The following resources can be filtered with theses query parameters
name
: insensitive contains lookup on name
fieldowner
: exact match on owner iddevice_name
: insensitive contains lookup on device_name
fieldserial_number
: insensitive contains lookup on serial_number
fielddevice_type
: exact match on device_type
fieldactivation_time_from
: greater than or equal lookup on activation_time
fieldactivation_time_to
: lesser than or equal lookup on activation_time
fielddevice
: exact match on device idathlete
: exact match on athlete idowner
: exact match on owner idactivity
: exact match on activity idstart_time_from
: greater than or equal lookup on start_time
fieldstart_time_to
: lesser than or equal lookup on start_time
fieldend_time_from
: greater than or equal lookup on end_time
fieldend_time_to
: lesser than or equal lookup on end_time
fieldemail
: insensitive contains lookup on email
fieldusername
: insensitive contains lookup on username
fieldexternal_id
: insensitive contains lookup on external_id
fieldfirst_name
: insensitive contains lookup on first_name
field of the athelte profilelast_name
: insensitive contains lookup on last_name
field of the athelte profilegender
: insensitive exact match on gender
field of the athelte profilemanaged_by
: exact match on managed_by idbirthdate_from
: greater than or equal lookup on birthdate
field of the athelte profilebirthdate_to
: lesser than or equal lookup on birthdate
field of the athelte profileRequesting 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_id
field was confusing, it has been renamed to device_name
id
device_name
serial_number
device_type
firmware_version
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/