Individual Athletes
Individual Athletes are users who are both device owners (like Managers) and device wearers (like Athletes). This kind of account is suitable for anyone who wants to use their own tracker and analyze their own data, as an individual rather than as the staff member of some organization. It is also suitable for coaches or staff (i.e Managers) who want to try out their devices themselves instead of relying on other athletes to collect data.
Such users are represented by a Manager account with a single Managed Athlete associated at its creation. We refer to this particular Managed Athlete as the Default Athlete of the Manager.
Registration using the web form
End-users can register using the dedicated registration form or from the homepage using the link ""Register (as individual athlete)" as below:
Registration using the API
To create an individual manager, use the regular Manager creation endpoint with the create_default_athlete
query parameter, as in the following example:
// POST /api/v1/managers/?create_default_athlete=true
{
"username": "john.doe@example.com",
"email": "john.doe@example.com",
"password": "***********",
"manager_profile": {
"first_name": "John",
"last_name": "Doe"
},
"athlete_profile": {
"first_name": "John",
"last_name": "Doe",
"gender": "M",
"weight": 80.0,
"height": 170.0,
"birth_date": "1997-03-12",
"nationality": "CH",
"profile_picture": "<base64>"
}
}
Notice in the response that the athlete profile is not included since it is stored in the related Managed Athlete entity:
{
"id": 1234,
"username": "john.doe@example.com",
"email": "john.doe@example.com",
"external_id": null,
"manager_profile": {
"id": 5678,
"first_name": "John",
"last_name": "Doe"
}
}
Querying user information
In order to get the Default Athlete (if any) of a given Manager:
- List the Managed Athletes of the Manager:
GET /api/v1/athletes/?managed_by={manager_id}
- Iterate the resulting list and find the item with
"is_default_athlete": true
(don't forget to account for pagination) - If no such item, then the Manager has no Default Athlete
Getting the Manager of a given Athlete works the same as with any Managed Athlete: is is given by the managed_by
attribute. The is_default_athlete
attribute will tell you whether any given Athlete is the Default Athlete of this manager (if not, it is a "regular" Managed Athlete).