API Usage
John Morgan avatar
Written by John Morgan
Updated over a week ago

The ManageXR API provides a RESTful way to access your device data.

Looking for our old API page? Find information about the legacy API here.

API Location

Our API is located at https://managexrapi.com. Note the requirement for https, and the lack of www.

Authorization

To access the REST API, send an HTTPS request with the header:

Authorization: Basic <encoded_credentials>

To create the <encoded_credentials>, Base64 encode the following string:

<api_key_id>:<api_key_secret>. If you're sending these via curl or something like axios, you won't need to encode them.

To generate these credentials, go to the API Keys settings page.

Quota

To ensure our API is accessible, we enforce the current quota limit:

  • 10 requests per second per organization

  • 2.5 million requests per month per organization

You will be given direct feedback if you are over quota and your requests will fail. If you have requirements above this and would like to discuss expanding your quota, contact us at support@managexr.com.

Organization, Device, and Configuration IDs

Each organization has a unique ID. To get this and use it in the below examples, go to your organization’s API Keys page - it will be listed right above the API keys.

You can also examine the url when accessing an organization from the dashboard. The string where :orgId is below is the ID of the organization.

You can access Device IDs from the endpoints below, but their ID is also their serial number.

For configurations and most other documents, you can also use a similar pattern to grab an ID manually (and we plan to expose these IDs in other ways as they become used more often). For example, a configuration ID follows a similar pattern to the orgId, when looking at editing a configuraition:

Accessing Endpoints

Each endpoint must be accessed using HTTPS and a valid auth header.

Below, we use Typescript syntax. We may define custom types for clarity. A ? next to a field means it is optional. Otherwise, it is required.

Devices Endpoints

Get Organization Devices

method: GET

Response: JSON array of all device data

Example:

curl -D- -u $API_KEY_ID:$API_KEY_SECRET -X GET https://managexrapi.com/organizations/fakeOrgId/devices/

Send Device Command

method: POST

body:

{
action: DeviceCommandAction
// Required for specific device commands, see below.
data?: object
}

Where we support the following device commands:

 enum DeviceCommand {
// Have the device sync with ManageXR and get updated runtime settings, apps, etc
‘SYNC’,

// Disable Kiosk Mode.
'DISABLE_KIOSK',

// Enable Kiosk Mode. This requires your configuration has a Kiosk Mode app set.
'ENABLE_KIOSK',

// Launch an App on the device. Requires the data field to be populated
// with a packageName and optionally, may include launchParams:
{ packageName: string,
launchParams?: {
userId: 'AX3EIUf89',
booleanValue: true,
floatValue: 100.29,
arrayValue: [1.23, 4.56],
mapValue: { key: 'more stuff', }
}
}
'LAUNCH_APP',

// Play a video on the device. Requires the data field to be populated with:
// { videoId: string }
PLAY_VIDEO,

// Pause a video on the device. Requires the data field to be populated with:
// { videoId: string }
PAUSE_VIDEO,

// Launch a webxr link on the device. Requires the data field to be populated with:
// { url: string }
LAUNCH_WEB_URL,

// Restart the device.
'RESTART',

// Uninstall an App on the device. Requires the data field to be populated with:
// { packageName: string }
'UNINSTALL_APP',

// Enables Tutorial Mode on the device.
'ENABLE_TUTORIAL_MODE',

// Disables Tutorial Mode on the device.
'DISABLE_TUTORIAL_MODE',
}

Example:

curl --data \

'{ "action": "LAUNCH_APP", "data": {"packageName": "your.app.apk" } }' \

-H 'Content-Type: application/json' \

-u $API_KEY_ID:$API_KEY_SECRET -X POST \

Edit Device

method: PATCH

body:

{
// The device name as displayed in the ManageXR console.
name?: string

// Custom device notes as displayed in the ManageXR console.
notes?: string

// The configurationId to place the device on, which will cause
// it to sync to this new config as soon as it is online.
// Find this ID manually by looking at the URL in the web
// console when editing a configuration. See the above section
// "Organization, Device and Configuration IDs" for more info.
configurationId?: string;
}

Example:

curl --data '{ "name": "QUEST_100", "notes": "This device has been having poor battery life" }' -H 'Content-Type: application/json' -u $API_KEY_ID:$API_KEY_SECRET -X PATCH https://managexrapi.com/organizations/fakeOrgId/devices/PA7940MGD7240113B

Did this answer your question?