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

  1. Lookup users based on email, customid, personnummer, ssn, etc.
  2. Create or update a user in ExorLive.
  3. Set the event callback URL.

Demo

A simple demo-application written in Javascript is found here: https://exorlive.com/test/UserDemo.html

The endpoints

Each call expects two values in the HTTP header:
  • "ExorLive-Client": The "clientname" to be agreed upon with ExorLive AS.
  • "Authorization": "Bearer accesstoken"
See the authentication section about how to get the access token.
A new swaggerdocumentation shows other user methods.

SetUser

Call this to create or update a user object.
NameSetUser
Urlhttps://exorlive.com/api4/user/setuser
MethodPOST
contentTypeapplication/json; charset=utf-8
Sample input
{
  "Id": 12345678,
  "OrganizationId": 123456,
  "DepartmentId": 0,
  "Role": 2,
  "PrimaryContactId": 123456,
  "Firstname": "Test",
  "Lastname": "Testson",
  "Email": "tester@exorlive.com",
  "Address": "",
  "City": "",
  "Zipcode": "",
  "Phone": "",
  "Comment": "",
  "DateOfBirth": "",
  "CustomId": "abcd-123-def-456",
  "OfficialId": "050780-12345",
  "Gender": 1
}
Id0: create new user
Else: Update existing user
OrganizationId[Optional]
Leave our or set to 0 to use the organization of the logged in user.
DepartmentId[Optional]
Specify a department within the organization, if applicable, otherwise 0.
Role[Optional]
0: Contact
2: Administrator.
8: Instructor
16: Contact With Login
256: Assistant
PrimaryContactId[Optional]
The User Id of the primary contact/user of this user. Usually the user who created this user.
Firstname
Lastname
Email
Address
City
Zipcode
Phone
Comment
[Optional]
Leave them out of the call to leave any old value unchanged.
DateOfBirth[Optional]
Birthdate in the format YYYY-MM-DD
CustomId[Optional]
Lookup the user to see if it already exists, even if Id=0
OfficialId[Optional]
Lookup the user to see if it already exists, even if Id=0.
Will not be stored in clear text in the database.
Gender[Optional]
0: Unknown
1: Male
2: Female

Lookup User

Call this to find one or more user objects.
NameLookupUser
Urlhttps://exorlive.com/api4/user/lookupuser
MethodGET
Input
  • type: email|id|name|customid|officialid
  • text: Text to search for
Sample calls
  • https://exorlive.com/api4/user/lookupuser?type=email&text=vilhelm@exorlive.com
  • https://exorlive.com/api4/user/lookupuser?type=officialid&text=05078012345

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
NameGetGoInvitationLink
Urlhttps://exorlive.com/osloapi/access/GetGoInvitationLink
MethodGET
Input
  • contactUserId: The ExorLive UserId of the contact
Sample calls
  • https://exorlive.com/osloapi/access/GetGoInvitationLink?contactUserId=12345

Set event callback URL

Specify a URL that will receive http-requests when certain events happens.
NameSetEventCallbackUrl
Urlhttps://exorlive.com/api4/user/SetEventCallbackUrl
MethodGET
Input
  • callbackUrl: must be a valid URL that may receive GET-requests from exorlive.com
Sample calls
  • https://exorlive.com/api4/user/SetEventCallbackUrl?callbackUrl=https%3A%2F%2Fmydomain.com%2Fevents%2F
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:
  • event
  • userId
Supported events are: Example:
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