ExorLive Users API
A "user" in this context can be either:- Instructor: A Professional user that creates exercise programs.
- Administrator: A user with higher privileges than an instructor. Administrates other users.
- Contact With Login: A client/patient which can use the ExorLive GO mobile app.
- Contact: A client/patient without any access. Is just an entry in the contacts-list of the instructor.
Description
- Lookup users based on email, customid, personnummer, ssn, etc.
- Create or update a user in ExorLive.
- Set the event callback URL.
Demo
A simple demo-application written in Javascript is found here: https://exorlive.com/test/UserDemo.htmlThe endpoints
Each call expects two values in the HTTP header:- "ExorLive-Client": The "clientname" to be agreed upon with ExorLive AS.
- "Authorization": "Bearer accesstoken"
A new swaggerdocumentation shows other user methods.
SetUser
Call this to create or update a user object.Name | SetUser | ||||||||||||||||||||
Url | https://exorlive.com/api4/user/setuser | ||||||||||||||||||||
Method | POST | ||||||||||||||||||||
contentType | application/json; charset=utf-8 | ||||||||||||||||||||
Sample input |
|
Lookup User
Call this to find one or more user objects.Name | LookupUser |
Url | https://exorlive.com/api4/user/lookupuser |
Method | GET |
Input |
|
Sample calls |
|
GetGoInvitationLink
- Call this method to get a link that can be sent to a contact to invite that contact to Exorlive Go. The link will be similar to the link in the email that is sent using the "invite" button in the ExorLive application.
- The caller must provide the ExorLive user id of the contact. That may be retrieved using LookupUser
Name | GetGoInvitationLink |
Url | https://exorlive.com/osloapi/access/GetGoInvitationLink |
Method | GET |
Input |
|
Sample calls |
|
Set event callback URL
Specify a URL that will receive http-requests when certain events happens.Name | SetEventCallbackUrl |
Url | https://exorlive.com/api4/user/SetEventCallbackUrl |
Method | GET |
Input |
|
Sample calls |
|
Remarks |
The URL is stored for the organization of the logged in user and applies to any events for that organization. When an event is triggered in ExorLive, a http-request is fired to the URL registered. ExorLive will append these parameters to the URL:
Callback URL:
https://mycomain.com/events/
ExorLive will send:
https://mycomain.com/events/?event=workoutReady&userId=1234
Callback URL:
https://mycomain.com/events/?source=exorlive
ExorLive will send:
https://mycomain.com/events/?source=exorlive&event=workoutReady&userId=1234
|
GetUserAccessStatus
- Preconditon: An accesstoken has been retrieved using the authentication methods on your partner ExorLive user ID.
- Http-GET
This is a nice convenience method to check the status of a user Id.
If statusCode=OK this call will return:
{ "userId": 12345, "organizationOK": true, "userOK": true, "userStatus": "Administrator"}
UserStatus may be one of the following:
"OrganizationNotConnected"
"UserIsDisabled"
"Administrator"
"Instructor"
"ContactWithLogin"
"Contact"
C# sample code:
// Use the new version 4 of the API (api4)
string reqUri = ExorLiveAppDomain + "/api4/Access/GetUserAccessStatus";
var data = new Dictionary<string, string>
{
{"ClientKey", ClientKey},
{"userId", userId.ToString()}
};
string parameters = MakeQueryParameters(data);
string response = SendHttpRequest("GET", reqUri, "application/json", parameters, accessToken); // Do the call