ASI API (1.1.1)

Download OpenAPI specification:Download

This API aims to give access to ASI's devices' data on the behalf of these device's users. A getting started guide is available on https://api.asi.swiss/doc/getting_started.html. A JSON schema guide is available on https://api.asi.swiss/doc/jsonschema_guide.html. Note that every endpoint has a trailing slash that is not optional.

Version 1.1.1 (latest)

  • 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 Matlab 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/

Authentication

oauth2Security

This API uses OAuth 2 with the authorization code grant flow.

Security Scheme Type OAuth2
authorizationCode OAuth Flow
Authorization URL: /oauth2/authorize
Token URL: /oauth2/token
Scopes:
  • all -

    Access to all data

Account

Authenticated user personnal account and profile.

Get authenticated user account and profile data

This operation is restricted to authenticated users.

Authorizations:

Responses

Response samples

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

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:
Request Body schema: application/json
username
required
string

User's name used to authenticate himself/herself

email
required
string <email>

User's contact email address

external_id
string

User's external ID used from another organisation

manager_profile
object (ManagerProfile) Recursive

Responses

Request samples

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

Response samples

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

Retrieves a manager

This operation is restricted to the manager himself.

Authorizations:
path Parameters
manager
required
integer <int64>

Manager ID

Responses

Response samples

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