ASI API (1.22)

Download OpenAPI specification:Download

This API aims to give access to ASI's devices' data on the behalf of these device's users.

Warnings ⚠️

  • Note that every endpoint has a trailing slash that is not optional
  • API is protected by a throttling system to prevent abuse. When too many requests are made to the API by a client, API will respond with HTTP 429. Clients should check the Retry-After response's header indicating how long to wait before making a new request.

Changelog

Version 1.22 (latest)

  • Filter devices by activity (via linked timeframes)

Version 1.21

Version 1.20

  • Retrieve computed by activity

Version 1.19

  • Add search and ordering capabilities on resource listing endpoints for athletes, devices, JSON schemas, activities and timeframes
  • Add is_managed filter in athlete's list & retrieve endpoints
  • Add with_device, with_athlete and with_activity parameters to include representation of related resource in timeframe's list & retrieve endpoints
  • Filters & search also works on resource retrieve endpoints
  • List and retrieve device ownerships
  • Fixed birthdate filtering on athlete list endpoint
  • Update doc with dates examples instead of datetime

Version 1.18

  • Add nationality & profile_picture in athlete profile

Version 1.17

  • Add immediate_sending parameter for device bluetooth config update

Version 1.16

  • ⚠️ Remove email field from managed athlete
  • ⚠️ Add interval size limit to preprocessed data & preprocessed data ranges, respectively 2 and 14 days
  • ⚠️ Add throttling system to prevent abuse of the API
  • Add webhook system to let client register callback for activity and timeframes changes, see /api/v1/activities/{activity}/webhooks/
  • Add device's custom_name field and filter, see /api/v1/devices/{device}/set-custom-name/
  • Add JsonSchema's type and parent fields and filters, see /api/v1/json-schemas/

Version 1.15

  • Add user's role & extra permissions infos in account endpoint
    • The role is one of MANAGER, ATHLETE or MANUFACTURER
    • Extra permissions is an array of string indicating extra permission for the user. At this time, only can_create_managed_athletes is an extra permission

Version 1.14

Version 1.13

  • Add self registration web page available on https://api.asi.swiss/register
  • Fixed get bluetooth configurations of a device endpoint returning 502 in some cases

Version 1.12

  • Add new endpoint to get bluetooth configurations of a device

Version 1.11

  • Add new endpoint to retrieve the latest preprocessed data of a device

Version 1.10

  • ⚠️ Change URL from /matlab-jobs/ to /jobs/, the old one is still supported but will be deprecated in the future

Version 1.9

  • Many improvements on websocket stability under system load
  • New websockets URLs with versionning, starting with v1 (note that /api/ has been removed from websockets URLs):
    • wss://api.asi.swiss/ws/v1/preprocessed-data/{device}/
    • wss://api.asi.swiss/ws/v1/computed-data/{activity}/
    • wss://api.asi.swiss/ws/v1/computed-data/{activity}/{timeframe}/
  • ⚠️ Legacy websockets URLs will be deprecated in a future version
    • wss://api.asi.swiss/api/ws/preprocessed-data/{device}/
    • wss://api.asi.swiss/api/ws/computed-data/{activity}/
    • wss://api.asi.swiss/api/ws/computed-data/{activity}/{timeframe}/
  • Managed athletes can now be deleted by their manager using a new endpoint /api/v1/athletes/{athlete}/delete-managed/

Version 1.8

  • Added EXPERIMENTAL endpoint for devices bluetooth pairing configurations

Version 1.7

  • Added endpoint to retrieve a device latest timestamp

Version 1.6

  • Fixed sporadic failure of requests affecting timeframes and activities resulting in timeout
  • No more pause needed between requests affecting timeframes and activities

Version 1.5

  • Speed up the preprocessed data queries using cache mechanism, cache is invalidated after 120 seconds
  • Increase max page size of preprocessed data response to 25000 items (default is still 10000)
  • Return 400 bad request instead of 500 server error when passing disallowed parameters in /oauth2/token/ endpoint

Version 1.4.4

  • Same parameters for preprocessed and preprocessed-ranges endpoints
  • Fixed a bug causing server error during creation of manager user

Version 1.4.0

  • Support for params in websockets to enable reordering buffer of messages (checkout the getting started guide!)

Version 1.3.2

  • Fixed a bug where pagination of list of devices was inconsistent by ordering them by id

Version 1.3

  • Improve overall stability of the system
  • Fixed a bug at user creation

Version 1.2.2

  • Fixed a bug preventing users reading some preprocessed data
  • Internal changes

Version 1.2.1

  • Fixed a bug preventing users of creating timeframes

Version 1.2.0

  • Support for ISO date-time format in preprocessed data list endpoint (as an alternavive of timestamp format)
  • Support for ISO date-time format in preprocessed data ranges list endpoint (instead of date only)
  • Internal changes

Version 1.1.2

  • Internal changes

Version 1.1.1

  • Internal changes

Version 1.1.0

  • List device's preprocessed data ranges of activity
  • Internal changes

Version 1.0.2

  • Fixed a bug where taking ownership of an existing device returned 404
  • Internal changes

Version 1.0.1

  • Fixed a bug on user activation page
  • Fixed bugs on websockets streaming
  • Added ASI logo on pages

Version 1.0.0

  • ⚠️ This version has breaking changes, a migration guide is available at https://api.asi.swiss/doc/migration_v1.html
  • Route now contains the API version, currently /api/v1/ is the only one supported
  • Remove some fields on device resource
  • Taking ownership of device is now done on ASI website at https://api.asi.swiss/device-activation/ or via /take-ownership/ endpoint, /own/ is removed
  • Listing of resources now use pagination
  • Pagination of a device's preprocessed data has been updated to match general pagination parameters et response
  • Add some filtering options on listing of Activity, TimeFrame, Device and Athlete resources
  • For streaming of a device's preprocessed data, its id must be specified as path parameter (previously device_name)

Version 0.1.20

  • Internal changes

Version 0.1.19

  • Internal changes
  • Fix a bug where websockets could not be opened (502)

Version 0.1.18

  • Internal changes

Version 0.1.17

  • Internal changes

Version 0.1.16

  • Internal changes

Version 0.1.15

  • Fix a bug where time frames added to an activity after a websocket connection to computed data of this activity were not included to the stream
  • Creation / modification of managed athletes now require the manager to have a specific permission, which is given by the ASI support team if requested

Version 0.1.14

  • Fix incorrect computed data after timeframe or activity update, uuid of this objects are now internal fields so they will soon be removed from API resource representation
  • Fix a bug where a manager could not create managed athletes
  • Fix documentation about jobs
  • Add JSON schema guide

Version 0.1.13

  • Athlete accounts managed by managers
  • Add routes to retrieve athlete or manager by their external ID

Version 0.1.12

  • Timeframe and activity export to file
  • Removed device /activate/ and /deactivate/, replaced by /own/ and /release-ownership/

Account

Authenticated user personnal account and profile.

Get authenticated user account and profile data

This operation is restricted to authenticated users.

Authorizations:
oauth2Security

Responses

Response samples

Content type
application/json
Example
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    },
  • "role": "MANAGER",
  • "extra_permissions": [
    ]
}

Managers

Manager users are users that can interact with athletes and teams. They mainly assign performance data to athletes and invite into teams.

Creates a manager

This operation create a manager account and an email is sent to the user's email address, with the account credentials.

This operation is not restricted. Anyone can use this endpoint to register as a manager.

Authorizations:
oauth2Security
Request Body schema: application/json
username
required
string

User's name used to authenticate himself/herself

external_id
string

User's external ID used from another organisation

email
required
string <email>

User's contact email address

object (ManagerProfile)

Responses

Request samples

Content type
application/json
{
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    }
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    }
}

Retrieves a manager by its external id

This operation is restricted to the manager himself.

Authorizations:
oauth2Security
query Parameters
external-id
required
string

External ID

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    }
}

Retrieves a manager

This operation is restricted to the manager himself.

Authorizations:
oauth2Security
path Parameters
manager
required
integer

Manager ID

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    }
}

Updates a manager

This operation is restricted to the manager himself.

Authorizations:
oauth2Security
path Parameters
manager
required
integer

Manager ID

Request Body schema: application/json
username
required
string

User's name used to authenticate himself/herself

external_id
string

User's external ID used from another organisation

email
required
string <email>

User's contact email address

object (ManagerProfile)

Responses

Request samples

Content type
application/json
{
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    }
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "manager_profile": {
    }
}

Deletes a manager

This operation is restricted to the manager himself.

Authorizations:
oauth2Security
path Parameters
manager
required
integer

Manager ID

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

Changes the user's password

This operation is restricted to the manager himself.

Authorizations:
oauth2Security
path Parameters
manager
required
integer

Manager ID

Request Body schema: application/json
password
string <password>

User's plain password

Responses

Request samples

Content type
application/json
{
  • "password": "SuperPassword$$123"
}

Response samples

Content type
application/json
{
  • "detail": "Not found"
}

Athletes

Athletes are users whose performances are:

  1. Measured using ASI's sensors
  2. Uploaded into the platform to be assigned and analysed by other users.

Lists athlete users

This operation is restricted to manager users. It lists athletes on whom they currently have READ permission.

Authorizations:
oauth2Security
query Parameters
page
integer

Page number

limit
integer

Number of results per page (max is 3000)

ordering
string
Enum: "username" "email" "external_id" "first_name" "last_name" "gender" "birthdate" "managed_by"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • External ID
  • Username
  • Email
  • Last name
  • First name
email
string

Filter on email (insensitive contains)

username
string

Filter on username (insensitive contains)

external_id
string

Filter on external_id (insensitive contains)

first_name
string

Filter on first_name (insensitive contains)

last_name
string

Filter on last_name (insensitive contains)

gender
string

Filter on gender (M or F) (insensitive exact)

managed_by
number

Filter by managed_by (id of manager)

is_managed
boolean

Filter managed or non managed athletes (valid options are true or false)

birthdate_from
string <date>
Example: birthdate_from=1996-01-01

Filter on birthdate (greater than or equal)

birthdate_to
string <date>
Example: birthdate_to=1998-12-31

Filter on birthdate (lesser than or equal)

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Creates an athlete user

This operation create an athlete account and an email is sent to the user's email address, with the account credentials.

This operation is not restricted. Anyone can use this endpoint to register as an athlete.

Authorizations:
oauth2Security
Request Body schema: application/json
username
required
string

User's name used to authenticate himself/herself

external_id
string

User's external ID used from another organisation

email
required
string <email>

User's contact email address

object (AthleteProfile)

Responses

Request samples

Content type
application/json
{
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "athlete_profile": {
    }
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Creates a managed athlete user

This operation create an athlete account managed by a manager.

Username will be a random UUID prefixed by MANAGED- and email will be empty.

This operation target to simplify athlete account creation and permission request processes. Athletes do not need to create their own accounts and accept permissions request. Athlete account created like this are not meant to be logged in to.

This operation is restricted to manager users. The manager must have a specific permission to manage managed athletes, which is given by the ASI support team if requested.

Authorizations:
oauth2Security
Request Body schema: application/json
external_id
string

User's external ID used from another organisation

managed_by
required
integer

Reference the manager who manage this athlete account. Only managers can create athlete with this field, and the must put their own id. A set of read, write and share permissions are created for this manager at athlete creation, from 1970-01-01 to 2199-12-31

object (AthleteProfile)

Responses

Request samples

Content type
application/json
{
  • "external_id": "0123456789",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Retrieves an athlete by its external id

This operation is restricted to manager users who currently have READ permission on this athlete and the athlete himself.

Authorizations:
oauth2Security
query Parameters
external-id
required
string

External ID

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Find athlete by username

Find an athlete id given its username.

This operation is restricted to manager users.

Authorizations:
oauth2Security
query Parameters
email
required
string

Email

Responses

Response samples

Content type
application/json
{
  • "id": 12
}

Find athletes by email

Find athletes id given an email. This operation is restricted to manager users.

Authorizations:
oauth2Security
query Parameters
email
required
string

Email

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieves an athlete

This operation is restricted to manager users who currently have READ permission on this athlete and the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

query Parameters
ordering
string
Enum: "username" "email" "external_id" "first_name" "last_name" "gender" "birthdate" "managed_by"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • External ID
  • Username
  • Email
  • Last name
  • First name
email
string

Filter on email (insensitive contains)

username
string

Filter on username (insensitive contains)

external_id
string

Filter on external_id (insensitive contains)

first_name
string

Filter on first_name (insensitive contains)

last_name
string

Filter on last_name (insensitive contains)

gender
string

Filter on gender (M or F) (insensitive exact)

managed_by
number

Filter by managed_by (id of manager)

is_managed
boolean

Filter managed or non managed athletes (valid options are true or false)

birthdate_from
string <date>
Example: birthdate_from=1996-01-01

Filter on birthdate (greater than or equal)

birthdate_to
string <date>
Example: birthdate_to=1998-12-31

Filter on birthdate (lesser than or equal)

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Updates an athlete

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

query Parameters
ordering
string
Enum: "username" "email" "external_id" "first_name" "last_name" "gender" "birthdate" "managed_by"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • External ID
  • Username
  • Email
  • Last name
  • First name
email
string

Filter on email (insensitive contains)

username
string

Filter on username (insensitive contains)

external_id
string

Filter on external_id (insensitive contains)

first_name
string

Filter on first_name (insensitive contains)

last_name
string

Filter on last_name (insensitive contains)

gender
string

Filter on gender (M or F) (insensitive exact)

managed_by
number

Filter by managed_by (id of manager)

is_managed
boolean

Filter managed or non managed athletes (valid options are true or false)

birthdate_from
string <date>
Example: birthdate_from=1996-01-01

Filter on birthdate (greater than or equal)

birthdate_to
string <date>
Example: birthdate_to=1998-12-31

Filter on birthdate (lesser than or equal)

Request Body schema: application/json
username
required
string

User's name used to authenticate himself/herself

external_id
string

User's external ID used from another organisation

email
required
string <email>

User's contact email address

object (AthleteProfile)

Responses

Request samples

Content type
application/json
{
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "athlete_profile": {
    }
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Deletes an athlete

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

query Parameters
ordering
string
Enum: "username" "email" "external_id" "first_name" "last_name" "gender" "birthdate" "managed_by"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • External ID
  • Username
  • Email
  • Last name
  • First name
email
string

Filter on email (insensitive contains)

username
string

Filter on username (insensitive contains)

external_id
string

Filter on external_id (insensitive contains)

first_name
string

Filter on first_name (insensitive contains)

last_name
string

Filter on last_name (insensitive contains)

gender
string

Filter on gender (M or F) (insensitive exact)

managed_by
number

Filter by managed_by (id of manager)

is_managed
boolean

Filter managed or non managed athletes (valid options are true or false)

birthdate_from
string <date>
Example: birthdate_from=1996-01-01

Filter on birthdate (greater than or equal)

birthdate_to
string <date>
Example: birthdate_to=1998-12-31

Filter on birthdate (lesser than or equal)

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

Updates a managed athlete

This operation is restricted to the manager user who manage this athlete.

The manager must have a specific permission to manage managed athletes, which is given by the ASI support team if requested.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

Request Body schema: application/json
external_id
string

User's external ID used from another organisation

managed_by
required
integer

Reference the manager who manage this athlete account. Only managers can create athlete with this field, and the must put their own id. A set of read, write and share permissions are created for this manager at athlete creation, from 1970-01-01 to 2199-12-31

object (AthleteProfile)

Responses

Request samples

Content type
application/json
{
  • "external_id": "0123456789",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "username": "jon.doe@example.com",
  • "external_id": "0123456789",
  • "email": "jon.doe@example.com",
  • "managed_by": 1,
  • "athlete_profile": {
    }
}

Deletes a managed athlete

This operation is restricted to the manager of this athlete.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

Changes the user's password

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

Request Body schema: application/json
password
string <password>

User's plain password

Responses

Request samples

Content type
application/json
{
  • "password": "SuperPassword$$123"
}

Response samples

Content type
application/json
{
  • "detail": "Not found"
}

ManagerPermissions

As an athlete, it is possible to give read, write or share permissions to manager users.

Lists all the permissions regarding to an athlete

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Lists a manager's permissions regarding to an athlete

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

manager
required
integer

Manager ID

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Creates permissions to a manager

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

manager
required
integer

Manager ID

Request Body schema: application/json
start_time
string <date-time>
expiration_time
string <date-time>
permission
string
Enum: "READ" "WRITE" "SHARE"

Responses

Request samples

Content type
application/json
{
  • "start_time": "2020-02-20T13:18:29+0100",
  • "expiration_time": "2022-02-20T13:18:29+0100",
  • "permission": "READ"
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "manager": 1,
  • "athlete": 2,
  • "start_time": "2020-02-20T13:18:29+0100",
  • "expiration_time": "2022-02-20T13:18:29+0100",
  • "permission": "READ",
  • "is_active": true
}

Revokes all permissions to a manager

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

manager
required
integer

Manager ID

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

Revokes a specific permission to a manager

This operation is restricted to the athlete himself.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

manager
required
integer

Manager ID

permission
required
integer

Permission ID

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

Shares a read permission to another manager

The authenticated manager needs to have a SHARE permission on the athlete.

This action gives read access to the specified manager on the athlete.

To get WRITE access, the athletes needs to grant this permission to the manager.

This operation is restricted to manager users.

Authorizations:
oauth2Security
path Parameters
athlete
required
integer

Athlete ID

Request Body schema: application/json
manager
integer
start_time
string <date-time>
expiration_time
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "manager": 10,
  • "start_time": "2020-02-20T13:18:29+0100",
  • "expiration_time": "2022-02-20T13:18:29+0100"
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "manager": 1,
  • "athlete": 2,
  • "start_time": "2020-02-20T13:18:29+0100",
  • "expiration_time": "2022-02-20T13:18:29+0100",
  • "permission": "READ",
  • "is_active": true
}

Devices

Devices are sensors developped and made available by ASI.

Lists devices

This operation is restricted to manager users. It lists all devices they ever owned.

If current is true, it lists only devices they currently own.

Authorizations:
oauth2Security
query Parameters
page
integer

Page number

limit
integer

Number of results per page (max is 3000)

ordering
string
Enum: "device_name" "custom_name" "serial_number" "device_type" "activation_time"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Device name
  • Custom name
  • Serial number
current
boolean

If true, list only manager's devices currently owned. If not or unspecified, list all previously and currently owned devices.

device_name
string

Filter on device_name (insensitive contains)

serial_number
string

Filter on serial_number (insensitive contains)

device_type
string

Filter on device_type (exact match)

activation_time_from
string <date-time>
Example: activation_time_from=2020-02-20T13:00:00+0100

Filter on activation_time (greater than or equal)

activation_time_to
string <date-time>
Example: activation_time_to=2020-02-20T18:00:00+0100

Filter on activation_time (lesser than or equal)

custom_name
string

Filter on custom_name (insensitive contains)

activity
number

Filter by activity (id), device will show up if linked to a timeframe, itself linked to this activity

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Take ownership of a device

Give ownership to authenticated manager user and activate a device if it is not yet activated. Ownership start at request time and end at "2999-12-31T23:59:59.000Z".

This operation is restricted to the manager who currently owns the device or all manager users if device currently has no owner.

Authorizations:
oauth2Security
Request Body schema: application/json
serial_number
string

Serial number

device_name
string

Device name (identifier)

Responses

Request samples

Content type
application/json
{
  • "serial_number": "a8e035ee-66be-4c90-a82a-437ada22a8dd",
  • "device_name": "abcdefghij12345"
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "device_name": "864475041000000",
  • "serial_number": "a8e035ee-66be-4c90-a82a-437ada22a8dd",
  • "device_type": "Model X 2000 Series",
  • "firmware_version": "1.2.3",
  • "custom_name": "My device 123"
}

Retrieves a device

This operation is restricted to the manager user who currently owns this device.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

query Parameters
ordering
string
Enum: "device_name" "custom_name" "serial_number" "device_type" "activation_time"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Device name
  • Custom name
  • Serial number
current
boolean

If true, list only manager's devices currently owned. If not or unspecified, list all previously and currently owned devices.

device_name
string

Filter on device_name (insensitive contains)

serial_number
string

Filter on serial_number (insensitive contains)

device_type
string

Filter on device_type (exact match)

activation_time_from
string <date-time>
Example: activation_time_from=2020-02-20T13:00:00+0100

Filter on activation_time (greater than or equal)

activation_time_to
string <date-time>
Example: activation_time_to=2020-02-20T18:00:00+0100

Filter on activation_time (lesser than or equal)

custom_name
string

Filter on custom_name (insensitive contains)

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "device_name": "864475041000000",
  • "serial_number": "a8e035ee-66be-4c90-a82a-437ada22a8dd",
  • "device_type": "Model X 2000 Series",
  • "firmware_version": "1.2.3",
  • "custom_name": "My device 123"
}

Set device's custom name

This operation is restricted to the manager user who currently owns this device.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

Request Body schema: application/json
custom_name
string <= 60 characters

A string matching the regex /^[\w\_\-\ ]+$/

Responses

Request samples

Content type
application/json
{
  • "custom_name": "My device 123"
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "device_name": "864475041000000",
  • "serial_number": "a8e035ee-66be-4c90-a82a-437ada22a8dd",
  • "device_type": "Model X 2000 Series",
  • "firmware_version": "1.2.3",
  • "custom_name": "My device 123"
}

Relase device ownership

End authenticated manager user's current ownership on the device.

This operation is restricted to the manager who currently owns the device.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

Responses

Response samples

Content type
application/json
{
  • "message": "Device has never been activated."
}

Bulk load an ASI file for a device

The .asi file must be encoded in base64, then included in request body.

This operation is restricted to the manager who currently owns the device.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

Request Body schema: application/json
asi_b64
required
string

Base64 encoded .asi file

Responses

Request samples

Content type
application/json
{
  • "asi_b64": "QVNJAAAAEAQEBkFTSSBWMgAAAQUACAcIBwgHCAcIAhoAEAAQAA......"
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "job_id": "job-e429beeb-af8b-47ff-8e17-46e656fd5fa2",
  • "state": "SUCCESS",
  • "details": { }
}

Get bluetooth config for a device

For details about current and target configurations, see explanations for PATCH.

This operation is restricted to the manager who currently owns the device.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Configure bluetooth pairing for a device

Use a mac address to set a new value for pairing_n, assign null to pairing_n to remove the current value, omit pairing_n to leave it unchanged.

Only pairing_1 is supported at the moment and limited to heart rate sensors (GATT Service 0x180D Heart Rate).

There are two different configurations to consider:

  • current is the current configuration executed by the device as far as the server is aware. It will always be read only.
  • target is the configuration to be set on the device whenever it is ready to accept requests. This is the configuration that you can update. It will replace current only when the device starts and has successfully received the new configuration.

This means that a successful PATCH request is not guaranteed to result in a successful update to current. You should make sure to properly handle any difference between current and target before making any further update to target in order to avoid unwanted behavior.

This operation is restricted to the manager who currently owns the device.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

query Parameters
immediate_sending
boolean

If true, the configuration is immediately sent to device. Otherwise, it takes effect on device startup.

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{
  • "pairing_1": {
    }
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

DeviceOwnerships

Device ownerships define that a device is owned by a manager during a certain time

Lists device ownerships

This operation is restricted to manager users.

Authorizations:
oauth2Security
query Parameters
page
integer

Page number

limit
integer

Number of results per page (max is 3000)

device
string

Filter on device ID

device_name
string

Filter on device's device name (exact match)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T18:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2022-02-20T18:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2022-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "start_time": "2019-11-21T19:57:45.000Z",
  • "end_time": "2999-12-31T23:59:59.000Z",
  • "device": 1,
  • "manager": 1,
  • "device_details": {
    }
}

Retrieves a device ownership

This operation is restricted to manager users.

Authorizations:
oauth2Security
path Parameters
device_ownership
required
integer

Device ownership ID

query Parameters
device
string

Filter on device ID

device_name
string

Filter on device's device name (exact match)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T18:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2022-02-20T18:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2022-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "start_time": "2019-11-21T19:57:45.000Z",
  • "end_time": "2999-12-31T23:59:59.000Z",
  • "device": 1,
  • "manager": 1,
  • "device_details": {
    }
}

JsonSchemas

A JsonSchema is used to validate activities metadata (https://json-schema.org/). JsonSchema objects have a schema property, an example can be found here.

Lists JSON schemas

This operation is restricted to manager users.

Authorizations:
oauth2Security
query Parameters
page
integer

Page number

limit
integer

Number of results per page (max is 3000)

ordering
string
Enum: "name" "type" "parent"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Name
type
integer

Filter on type (exact match)

parent
integer

Filter on parent schema id (exact match)

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Retrieves a JSON schema

This operation is restricted to manager users.

Authorizations:
oauth2Security
path Parameters
json_schema
required
integer

JSON schema ID

query Parameters
ordering
string
Enum: "name" "type" "parent"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Name
type
integer

Filter on type (exact match)

parent
integer

Filter on parent schema id (exact match)

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "name": "timeframe_soccer",
  • "type": "TIMEFRAME",
  • "parent": 1,
  • "schema": { }
}

Activities

A activity can be a football game, a tennis game, bobsleigh session, etc. Activities objects have a json property, an example can be found here.

Lists activities

This operation is restricted to manager users. It lists activities he created.

Authorizations:
oauth2Security
query Parameters
page
integer

Page number

limit
integer

Number of results per page (max is 3000)

ordering
string
Value: "name"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Name
name
string

Filter on name (insensitive contains)

owner
number

Filter by owner (id of manager)

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Creates an activity

This operation is restricted to manager users.

Authorizations:
oauth2Security
Request Body schema: application/json
name
required
string
json
object
json_schema
integer
owner
integer

Responses

Request samples

Content type
application/json
{
  • "name": "Soccer of 21 nov 2020 at la maladière",
  • "json": { },
  • "json_schema": 1,
  • "owner": 1
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "uuid": "92d831c226ab47b0a548a357dd01d704",
  • "name": "Soccer of 21 nov 2020 at la maladière",
  • "json": { },
  • "json_schema": 1,
  • "owner": 1
}

Retrieves an activity

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

query Parameters
ordering
string
Value: "name"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Name
name
string

Filter on name (insensitive contains)

owner
number

Filter by owner (id of manager)

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "uuid": "92d831c226ab47b0a548a357dd01d704",
  • "name": "Soccer of 21 nov 2020 at la maladière",
  • "json": { },
  • "json_schema": 1,
  • "owner": 1
}

Updates an activity

Update an activity and trigger a new computation of all its time frame's computed data, asynchronously.

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

query Parameters
ordering
string
Value: "name"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Name
name
string

Filter on name (insensitive contains)

owner
number

Filter by owner (id of manager)

Request Body schema: application/json
name
required
string
json
object
json_schema
integer
owner
integer

Responses

Request samples

Content type
application/json
{
  • "name": "Soccer of 21 nov 2020 at la maladière",
  • "json": { },
  • "json_schema": 1,
  • "owner": 1
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "uuid": "92d831c226ab47b0a548a357dd01d704",
  • "name": "Soccer of 21 nov 2020 at la maladière",
  • "json": { },
  • "json_schema": 1,
  • "owner": 1
}

Deletes an activity

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

query Parameters
ordering
string
Value: "name"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

search
string

Multiple fields text search (case-insensitive partial matches).

  • Name
name
string

Filter on name (insensitive contains)

owner
number

Filter by owner (id of manager)

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

List activity's webhooks

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

Responses

Response samples

Content type
application/json
{}

Create an activity's webhook

Register a new webhook.

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

Request Body schema: application/json
webhook_url
required
string <url> <= 200 characters

The callback URL

secret_token
required
string <= 100 characters

The value to be added in the X-Asi-Api-Token header while requesting the callback url.

When listing or retrieving webhooks from the API, this value is partially hidden (for example 123*************).

activity_events
required
boolean

Whether to call this webhook on activity events for this activity: activity-updated or activity-destroyed

timeframes_events
required
boolean

Whether to call this webhook on timeframes events for timeframes related to this activity: timeframe-created, timeframe-updated or timeframe-destroyed

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Retrieves an activity's webhook

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

webhook
required
integer

Activity's webhook ID

Responses

Response samples

Content type
application/json
{}

Updates an activity's webhook

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

webhook
required
integer

Activity's webhook ID

Request Body schema: application/json
webhook_url
required
string <url> <= 200 characters

The callback URL

secret_token
required
string <= 100 characters

The value to be added in the X-Asi-Api-Token header while requesting the callback url.

When listing or retrieving webhooks from the API, this value is partially hidden (for example 123*************).

activity_events
required
boolean

Whether to call this webhook on activity events for this activity: activity-updated or activity-destroyed

timeframes_events
required
boolean

Whether to call this webhook on timeframes events for timeframes related to this activity: timeframe-created, timeframe-updated or timeframe-destroyed

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{}

Deletes an activity's webhook

This operation is restricted to the manager user who own this activity.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

webhook
required
integer

Activity's webhook ID

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

TimeFrames

Time frames made the link between an athlete, a device and an activity during a time interval. Time frames are managed by manager users. TimeFrame objects have a params property, an example can be found here.

Lists time frames

This operation is restricted to the manager users. It lists time frames he created. Optionally filtered by activity to which it's related.

Authorizations:
oauth2Security
query Parameters
page
integer

Page number

limit
integer

Number of results per page (max is 3000)

ordering
string
Enum: "start_time" "end_time" "device" "athlete" "activity"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

device
number

Filter by device (id)

athlete
number

Filter by athlete (id)

owner
number

Filter by owner (id of manager)

activity
number

Filter by activity (id)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T13:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2020-02-20T13:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2020-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

with_device
boolean

If true, include nested representation of the device in the response instead of its id

with_activity
boolean

If true, include nested representation of the activity in the response instead of its id

with_athlete
boolean

If true, include nested representation of the athlete in the response instead of its id

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Create a time frame

This operation is restricted to manager users.

Authorizations:
oauth2Security
Request Body schema: application/json
start_time
string <date-time>
end_time
string <date-time>
params
object
device
integer
activity
integer
athlete
integer
owner
integer
json_schema
integer

Responses

Request samples

Content type
application/json
{
  • "start_time": "2022-02-20T13:18:29+0100",
  • "end_time": "2022-02-20T14:18:29+0100",
  • "params": { },
  • "device": 1,
  • "activity": 1,
  • "athlete": 2,
  • "owner": 1,
  • "json_schema": 1
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "uuid": "92d831c226ab47b0a548a357dd01d704",
  • "start_time": "2022-02-20T13:18:29+0100",
  • "end_time": "2022-02-20T14:18:29+0100",
  • "params": { },
  • "device": 1,
  • "activity": 1,
  • "athlete": 2,
  • "owner": 1,
  • "json_schema": 1
}

Retrieves a time frame

This operation is restricted to the manager user who own this time frame.

Authorizations:
oauth2Security
path Parameters
timeFrame
required
integer

Time frame ID

query Parameters
ordering
string
Enum: "start_time" "end_time" "device" "athlete" "activity"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

device
number

Filter by device (id)

athlete
number

Filter by athlete (id)

owner
number

Filter by owner (id of manager)

activity
number

Filter by activity (id)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T13:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2020-02-20T13:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2020-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

with_device
boolean

If true, include nested representation of the device in the response instead of its id

with_activity
boolean

If true, include nested representation of the activity in the response instead of its id

with_athlete
boolean

If true, include nested representation of the athlete in the response instead of its id

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

Updates a time frame

Update a time frame and trigger a new computation of its computed data, asynchronously. This operation is restricted to the manager user who own this time frame.

Authorizations:
oauth2Security
path Parameters
timeFrame
required
integer

Time frame ID

query Parameters
ordering
string
Enum: "start_time" "end_time" "device" "athlete" "activity"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

device
number

Filter by device (id)

athlete
number

Filter by athlete (id)

owner
number

Filter by owner (id of manager)

activity
number

Filter by activity (id)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T13:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2020-02-20T13:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2020-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

with_device
boolean

If true, include nested representation of the device in the response instead of its id

with_activity
boolean

If true, include nested representation of the activity in the response instead of its id

with_athlete
boolean

If true, include nested representation of the athlete in the response instead of its id

Request Body schema: application/json
start_time
string <date-time>
end_time
string <date-time>
params
object
device
integer
activity
integer
athlete
integer
owner
integer
json_schema
integer

Responses

Request samples

Content type
application/json
{
  • "start_time": "2022-02-20T13:18:29+0100",
  • "end_time": "2022-02-20T14:18:29+0100",
  • "params": { },
  • "device": 1,
  • "activity": 1,
  • "athlete": 2,
  • "owner": 1,
  • "json_schema": 1
}

Response samples

Content type
application/json
{
  • "id": 12,
  • "uuid": "92d831c226ab47b0a548a357dd01d704",
  • "start_time": "2022-02-20T13:18:29+0100",
  • "end_time": "2022-02-20T14:18:29+0100",
  • "params": { },
  • "device": 1,
  • "activity": 1,
  • "athlete": 2,
  • "owner": 1,
  • "json_schema": 1
}

Updates a time frame (partially)

Works the same as PUT, but support partial payload, specifying only the fields to update.

Authorizations:
oauth2Security
path Parameters
timeFrame
required
integer

Time frame ID

query Parameters
ordering
string
Enum: "start_time" "end_time" "device" "athlete" "activity"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

device
number

Filter by device (id)

athlete
number

Filter by athlete (id)

owner
number

Filter by owner (id of manager)

activity
number

Filter by activity (id)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T13:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2020-02-20T13:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2020-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

with_device
boolean

If true, include nested representation of the device in the response instead of its id

with_activity
boolean

If true, include nested representation of the activity in the response instead of its id

with_athlete
boolean

If true, include nested representation of the athlete in the response instead of its id

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "uuid": "92d831c226ab47b0a548a357dd01d704",
  • "start_time": "2022-02-20T13:18:29+0100",
  • "end_time": "2022-02-20T14:18:29+0100",
  • "params": { },
  • "device": 1,
  • "activity": 1,
  • "athlete": 2,
  • "owner": 1,
  • "json_schema": 1
}

Deletes a time frame

This operation is restricted to the manager user who own this time frame.

Authorizations:
oauth2Security
path Parameters
timeFrame
required
integer

Time frame ID

query Parameters
ordering
string
Enum: "start_time" "end_time" "device" "athlete" "activity"

Order the results by specified field, ascendant. Prefix the field with - to reverse order.

device
number

Filter by device (id)

athlete
number

Filter by athlete (id)

owner
number

Filter by owner (id of manager)

activity
number

Filter by activity (id)

start_time_from
string <date-time>
Example: start_time_from=2020-02-20T13:00:00+0100

Filter on start_time (greater than or equal)

start_time_to
string <date-time>
Example: start_time_to=2020-02-20T18:00:00+0100

Filter on start_time (lesser than or equal)

end_time_from
string <date-time>
Example: end_time_from=2020-02-20T13:00:00+0100

Filter on end_time (greater than or equal)

end_time_to
string <date-time>
Example: end_time_to=2020-02-20T18:00:00+0100

Filter on end_time (lesser than or equal)

with_device
boolean

If true, include nested representation of the device in the response instead of its id

with_activity
boolean

If true, include nested representation of the activity in the response instead of its id

with_athlete
boolean

If true, include nested representation of the athlete in the response instead of its id

Responses

Response samples

Content type
application/json
{
  • "detail": "You do not have permission to perform this action."
}

ComputedData

Computed data from a device worn by an athlete during an activity. Typically min/max values or average of some data.

Retrieves an activity's computed data

The result is a list of all computed data of this activity's time frames.

This operation is restricted to manager users who have READ permission on the referenced athlete between start_time and end_time of this time frame.

Authorizations:
oauth2Security
path Parameters
activity
required
integer

Activity ID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieves a time frame's computed data

This operation is restricted to manager users who have READ permission on the referenced athlete between start_time and end_time of this time frame.

Authorizations:
oauth2Security
path Parameters
timeFrame
required
integer

Time frame ID

Responses

Response samples

Content type
application/json
{
  • "average_speed": 0,
  • "max_hr": 0,
  • "max_speed": 0,
  • "total_distance": 0
}

PreprocessedData

Preprocessed data from a device worn by an athlete during an activity. Typically raw data with enhancement, like position in GPS cooridnates and relative to the field.

Retrieve device's latest timestamp

This operation is restricted to the manager who currently owns the device

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

Responses

Response samples

Content type
application/json
{
  • "timestamp": 1636800211900,
  • "datetime": "2021-11-13T10:43:31.900000+00:00"
}

Retrieve device's latest preprocessed data

The response is unpaginated, and the items are ordered by timestamp in reverse order.

This operation is restricted to the manager who currently owns the device

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

query Parameters
size
integer

Number of data to retrieve (max is 300)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Lists device's preprocessed data ranges of activity

A range is determined by a group of data close to another of 5 minutes or less between the previous and the next.

Interval between start and stop cannot exceed 14 days.

This operation is restricted to the manager who owned the device between start and stop.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

query Parameters
required
integer or string
Example: start=1622246400000 or 2021-05-29T00:00:00+0000

Sample start time in timestamp format in [ms] or in iso datetime format

required
integer or string
Example: stop=1622419200000 or 2021-05-31T00:00:00+0000

Sample stop time in timestamp format in [ms] or in iso datetime format

start_iso
required
string <date-time>
Deprecated
Example: start_iso=2021-05-29T00:00:00+0000

Query start datetime in iso format

stop_iso
required
string <date-time>
Deprecated
Example: stop_iso=2021-05-31T00:00:00+0000

Query stop datetime in iso format

page
integer

Page number

limit
integer

Number of results per page (max is 3000)

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Lists device's preprocessed data

Results of this query is cached for performance reasons. Cache is invalidated after 120 seconds.

Interval between start and stop cannot exceed 2 days.

This operation is restricted to the manager who owned the device between start and stop.

Authorizations:
oauth2Security
path Parameters
device
required
integer

Device ID

query Parameters
required
integer or string
Example: start=1622246400000 or 2021-05-29T00:00:00+0000

Sample start time in timestamp format in [ms] or in iso datetime format

required
integer or string
Example: stop=1622419200000 or 2021-05-31T00:00:00+0000

Sample stop time in timestamp format in [ms] or in iso datetime format

start_iso
required
string <date-time>
Deprecated
Example: start_iso=2021-05-29T00:00:00+0000

Query start datetime in iso format

stop_iso
required
string <date-time>
Deprecated
Example: stop_iso=2021-05-31T00:00:00+0000

Query stop datetime in iso format

page
integer

Page number

limit
integer

Number of results per page (default is 10000, max is 25000)

Responses

Response samples

Content type
application/json
{
  • "count": 150,
  • "page": 2,
  • "next": 3,
  • "previous": 1,
  • "results": [
    ]
}

Jobs

Computing jobs states and details.

Get state and infos about a job

Replace /api/v1/matlab-jobs/{job}/info/.

Authorizations:
oauth2Security
path Parameters
job
required
string
Example: job-e429beeb-af8b-47ff-8e17-46e656fd5fa2

Job identifier

Responses

Response samples

Content type
application/json
{
  • "id": 12,
  • "job_id": "job-e429beeb-af8b-47ff-8e17-46e656fd5fa2",
  • "state": "SUCCESS",
  • "details": { }
}