Skip to main content

Mason Device Console API Docs (v1.0)

Download OpenAPI specification:Download

Mason Device Console API

The Mason Device Console APIs provide programmatic access to manage and control your fleet of Mason devices. These APIs enable you to:

  • Authentication: Get JWT tokens for API access
  • Device Management: Get device information, send commands, and retrieve telemetry data
  • Application Management: Install, update, and manage applications on devices
  • Configuration: Apply remote settings and manage device configurations
  • OTA Updates: Schedule and manage firmware updates
  • File Management: Upload and manage files for distribution to devices
  • Filtering: Create and manage device groups based on various criteria

Base URL

All API endpoints use the base URL: https://mason.glbth.com

Authentication

All API calls require authentication using JWT tokens obtained through the login endpoints. API responses follow a consistent structure with status information and payload data.

Remote settings APIs

APIs for managing remote settings

Save Remote Settings

This API endpoint enables the creation or update of remote settings bundles. It requires an HTTP POST request with a RemoteSettingsBundle object provided in the request body. The API checks the logged user's permissions, sets the creation date if it's a new bundle, and then saves the remote settings bundle.

Authorizations:
bearer-key
Request Body schema: application/json
required
settingsBundleId
string
settingsBundleName
string
description
string
domain
string
owner
string
settingsType
string
color
string
fontIcon
string
privateRepoItem
boolean
object
Array of objects (RemoteSettingsItem)
creationDate
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "settingsBundleId": "string",
  • "settingsBundleName": "string",
  • "description": "string",
  • "domain": "string",
  • "owner": "string",
  • "settingsType": "string",
  • "color": "string",
  • "fontIcon": "string",
  • "privateRepoItem": true,
  • "moreData": {
    },
  • "remoteSettingsItems": [
    ],
  • "creationDate": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
No sample

Login APIs

APIs that are responsible for login operations

Refreshes a JWT token

This endpoint allows users to refresh a JWT token. It takes the refreshToken, which was received in the getjwttoken API and generates a new jwt token in the request body.

Authorizations:
bearer-key
header Parameters
accountuser
required
string

The user name associated with the JWT token.

Request Body schema: application/json
required
userName
string

The user name associated with the JWT token.

refreshToken
string

The refresh token used to obtain a new JWT token.

Responses

Request samples

Content type
application/json
{
  • "userName": "string",
  • "refreshToken": "string"
}

Response samples

Content type
application/json
No sample

Gets a JWT token.

This endpoint allows users to obtain a JWT token (short expiration) and a refresh token (long expiration) for authentication of further API calls. It takes a JSON object containing the username and password (required fields) in the request body. The method performs authentication, generates tokens, and handles various authentication exceptions

Authorizations:
bearer-key
Request Body schema: application/json
required
username
required
string

Username of the user

password
required
string

Password of the user

totpcode
string

TOTP code (Time-Based One-Time Password) for two-factor authentication

idToken
string

ID token

ssoDomain
string

SSO (Single Sign-On) domain

refreshToken
string

Refresh token used for token renewal

Responses

Request samples

Content type
application/json

A sample login request with username and password

{
  • "username": "username@account",
  • "password": "mypassword"
}

Response samples

Content type
application/json
No sample

Command APIs

APIs responsible for device commands

Save and trigger a command

This API endpoint allows for the creation and saving of a new command. It takes a Command object as the request body which includes the execution condition as set in the reference trigger and returns the unique identifier (commandID) of the newly created command.

Authorizations:
bearer-key
Request Body schema: application/json
required
id
string

The unique identifier for the command.

creationTime
string <date-time>

The date and time when the command was created.

ownerUserName
string

The username of the owner of the command.

domain
string

The domain associated with the command.

object (CommandData)
object (Trigger)
description
string

A description of the command.

filterId
string

The ID of the filter associated with the command.

currentDevices
Array of strings

The list of devices currently targeted by the command.

state
string

The state of the command.

notifiedUsers
Array of strings unique

A set of usernames representing users who have been notified about the command.

notifyDirty
boolean

Flag indicating whether the command has unsaved changes.

lastChange
string <date-time>

The date and time of the last change to the command.

failureCount
integer <int32>

The count of failures associated with the command.

successCount
integer <int32>

The count of successful executions of the command.

sentCount
integer <int32>

The count of times the command has been sent.

executedCount
integer <int32>

The count of times the command has been executed.

readyCount
integer <int32>

The count of devices ready to receive the command.

persist
boolean

Flag indicating whether the command should be persisted for future reference.

persistentGroupID
string

The ID of the persistent group associated with the command.

persistentGroupName
string

The name of the persistent group associated with the command.

object

Additional properties associated with the command.

object (CommandStatus)

A list of command statuses.

Responses

Request samples

Content type
application/json
{
  • "id": "command123",
  • "creationTime": "2019-08-24T14:15:22Z",
  • "ownerUserName": "john_doe",
  • "domain": "example.com",
  • "commandData": {
    },
  • "trigger": {
    },
  • "description": "Activate Emergency Alert",
  • "filterId": "filter123",
  • "currentDevices": [
    ],
  • "state": "Pending",
  • "notifiedUsers": [
    ],
  • "notifyDirty": true,
  • "lastChange": "2019-08-24T14:15:22Z",
  • "failureCount": 3,
  • "successCount": 10,
  • "sentCount": 5,
  • "executedCount": 7,
  • "readyCount": 8,
  • "persist": true,
  • "persistentGroupID": "group123",
  • "persistentGroupName": "EmergencyAlertGroup",
  • "props": {
    },
  • "lastCommandStatus": {
    }
}

Response samples

Content type
application/json
No sample

Modify Command State

This API endpoint allows for the modification of the state of a command identified by its unique command ID. It initiates a state change based on the provided 'newstate' parameter.

Authorizations:
bearer-key
path Parameters
commandId
required
string
Example: command123

The unique identifier of the command.

query Parameters
newstate
required
string
Enum: "COMMAND_STATE_ACTIVE" "COMMAND_STATE_STOPPED"
Example: newstate=COMMAND_STATE_ACTIVE

The new state to set for the command.

Request Body schema: application/json
newstate
string

The new state of thee command

Responses

Request samples

Content type
application/json
{
  • "newstate": "COMMAND_STATE_ACTIVE"
}

Response samples

Content type
application/json
No sample

Send command to multiple devices

Send a command with provided data to multiple devices. Command could be any supported command such as send message command, install package command, OTA and more. Returns metadata about the sent command.

Authorizations:
bearer-key
Request Body schema: application/json
required
object (CommandData)
deviceIds
Array of strings

IDs of the devices that will receive the command

Responses

Request samples

Content type
application/json
{
  • "commandData": {
    },
  • "deviceIds": [
    ]
}

Response samples

Content type
application/json
No sample

Send command data to devices based on a filter (or group).

Creates a new command with provided data and sends it to devices based on a filter. Groups, which are filters filtered by tags, can also be a target for this command. The API returns metadata about the sent command.

Authorizations:
bearer-key
path Parameters
filterid
required
string
Example: filter123

The ID of the filter (or group) to target for sending the command.

query Parameters
ispersist
boolean
Default: false
Example: ispersist=true

Flag indicating whether the command should be persisted for future reference.

isall
boolean
Default: false
Example: isall=true

Flag indicating whether the command should be sent to all matching devices.

Request Body schema: application/json
required
object (AdvancedMessagingItem)
repositoryItemId
string
repositoryItemName
string
repositoryItemDesc
string
domain
string
owner
string
color
string
fontIcon
string
creationDate
string <date-time>
object
privateRepoItem
boolean
bodyText
string
object (AssetsItem)
object (AssetsItem)
stretchImage
boolean
horizontal
boolean
audioLoop
boolean
withTimeout
boolean
timeOut
integer <int32>
textColor
string
webUrl
string
youtubeLoop
boolean
htmlCode
string
embedUrl
string
embedType
string
youtubeBaseUrl
string
youtubeId
string
advMsgType
string

Responses

Request samples

Content type
application/json
Example
{
  • "advancedMessagingItem": {
    },
  • "@class": "CommandAdvancedMessaging"
}

Response samples

Content type
application/json
No sample

Retrieve a list of commands based on various filters.

This API retrieves a list of commands based on the provided filters. It supports pagination and filtering by action, search string, search type, search column, and more.

Authorizations:
bearer-key
query Parameters
startIndex
required
integer <int32>

The index from which to start retrieving commands in the paginated result.

pageSize
required
integer <int32>

The number of commands to include in each page of the paginated result.

action
string

Filter commands by a specific action.

searchstring
string

A string to search for within the commands.

searchType
string

The type of search to perform (e.g., exact match, partial match).

searchcolumn
string

The specific column to search within the commands.

withgrouppackages
boolean
Default: false

Indicates whether to include group packages along with individual commands (default is false).

v2
boolean

Indicates whether to use version 2 of the API (default is false).

Request Body schema: application/json
Array
property
string

The property to sort by.

direction
string

The sorting direction (e.g., ASC or DESC).

object

A HashMap for additional search parameters.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "commands": [
    ],
  • "message": "string",
  • "result": "string",
  • "totalRecordCount": 0
}

Get command by ID with additional information

Retrieves a command by its ID with additional metadata and returns a response containing the command and filter information if applicable

Authorizations:
bearer-key
path Parameters
commandId
required
string
Example: command123

The unique identifier of the command.

Responses

Response samples

Content type
application/json
No sample

Get statistics for a specific command.

This API retrieves statistics for a specific command based on its ID.

Authorizations:
bearer-key
path Parameters
commandId
required
string

Responses

Response samples

Content type
application/json
{
  • "totalDevices": 100,
  • "success": 80,
  • "ready": 90,
  • "executed": 120,
  • "fail": 20,
  • "count": 150,
  • "readyArr": [
    ]
}

Get command results.

This API retrieves command results for a specific command. It supports pagination and filtering by search string, sort column, sort order, and status filter.

Authorizations:
bearer-key
path Parameters
commandId
required
string
query Parameters
startIndex
required
integer <int32>
pageSize
required
integer <int32>
searchstring
string
sortcolumn
string
sortorder
string
statusfilter
string

Responses

Response samples

Content type
application/json
{
  • "commandStatus": [
    ],
  • "message": "string",
  • "result": "string",
  • "totalRecordCount": 0
}

Device live data APIs

APIs responsible for live data operations

Retrieve live data from a device

This endpoint allows the retrieval of live data from a specific device identified by its device ID. Device authentication is required. Upon receiving the request, the API triggers the retrieval of live data from the device through a background task. The live data is collected and stored in a container associated with the device session. The API returns the live data response, containing telemetry information and other relevant device data. The API has a rate limit of 1 API call for each user and device every 1 minute.

Authorizations:
bearer-key
path Parameters
deviceid
required
string
Example: device123

The ID of the device to retrieve live data from

query Parameters
include
string
Example: include=apps,diskstats

A comma-separated list of categories of data to return from the remote device. Options include 'apps' (information about installed applications), 'diskstats' (storage data), 'system_properties' (system properties), 'settings' (Android settings), and 'filesystem' (data about device volumes).

Responses

Response samples

Content type
application/json
No sample

Device Data APIs

APIs that are responsible for device data

Retrieves installed app statistics for a group

This endpoint retrieves installed app data for a specified group. The method requires authentication and a JSON payload containing package names and group information. The response contains summarized app data for the group along with metadata indicating the success of the operation

Authorizations:
bearer-key
Request Body schema: application/json
required
group
string

The name of the group for which installed app data is requested.

packages
Array of strings

A list of package names for specific apps within the group.

isall
boolean

Flag indicating whether to retrieve data for all apps in the group.

Responses

Request samples

Content type
application/json
{
  • "group": "Group1",
  • "packages": [
    ],
  • "isall": true
}

Response samples

Content type
application/json
No sample

Retrieve comprehensive device data

Access detailed information about a device with this API endpoint. It provides a more comprehensive view of the device's status, usage, and configuration compared to the dashboard data.

Authorizations:
bearer-key
path Parameters
deviceid
required
string
Example: device123

The id of the device to retrieve data from

query Parameters
fields
string

Responses

Response samples

Content type
application/json
No sample

Retrieve a paginated list of all devices

Use this API endpoint to retrieve a paginated list of all available devices. You can specify pagination, sorting, and filtering parameters to customize the result. The response is provided as a DeviceListResponse containing device information

Authorizations:
bearer-key
query Parameters
jtStartIndex
required
integer <int32>
jtPageSize
required
integer <int32>
jtSorting
required
string
searchcolumn
string
searchfilter
string
devicefilter
string
oemcols
string
sortcolumn
string
Default: "hardwareId"
extended
string
Default: "false"
sortdirection
string
Default: "dsc"

Responses

Response samples

Content type
application/json
{
  • "Message": "string",
  • "Result": "string",
  • "Records": [
    ],
  • "TotalRecordCount": 0
}

Repository APIs

APIs for repositories actions

Save Repository Item

This API endpoint is used to create or update a repository item. It expects an HTTP POST request with a RepositoryItemBase object in the request body. The API performs access control checks, executes pre-save operations, and then saves the repository item. If it's a new item, it sets the creation date before saving.

Authorizations:
bearer-key
Request Body schema: application/json
required
repositoryItemId
string
repositoryItemName
string
repositoryItemDesc
string
domain
string
owner
string
color
string
fontIcon
string
creationDate
string <date-time>
object
privateRepoItem
boolean
url
string
type
string
thumbnail
string
object

Responses

Request samples

Content type
application/json
Example
{
  • "repositoryItemId": "string",
  • "repositoryItemName": "string",
  • "repositoryItemDesc": "string",
  • "domain": "string",
  • "owner": "string",
  • "color": "string",
  • "fontIcon": "string",
  • "creationDate": "2019-08-24T14:15:22Z",
  • "moreData": {
    },
  • "privateRepoItem": true,
  • "url": "string",
  • "type": "string",
  • "thumbnail": "string",
  • "properties": {
    },
  • "@class": "AssetsItem"
}

Response samples

Content type
application/json
No sample

Get all repository items

This endpoint retrieves all repository items. It first checks the access control list (ACL) to ensure that the logged-in user has the necessary permissions abd then returns the list of all repository items.

Authorizations:
bearer-key

Responses

Response samples

Content type
application/json
No sample

Files APIs

APIs for managing files and packages

Save file or package repository item.

This API endpoint handles the saving of file data, including associated metadata. It requires an HTTP POST request with a RepositoryFileMetaData object provided in the request body. The API verifies the logged user's permissions, processes the file data, and then saves it. Once the file or package has been successfully stored, it can be sent to the device(s).

Authorizations:
bearer-key
Request Body schema: application/json
required
repositoryFileMetaDataID
string
fileID
string
fileName
string
fileLocation
string
ownerUser
string
ownerDomain
string
lastEditorUser
string
privateFile
boolean
fileDesc
string
fileAction
string
arguments
string
object
color
string
fontIcon
string
creationDate
string <date-time>
lastUpdate
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "repositoryFileMetaDataID": "string",
  • "fileID": "string",
  • "fileName": "string",
  • "fileLocation": "string",
  • "ownerUser": "string",
  • "ownerDomain": "string",
  • "lastEditorUser": "string",
  • "privateFile": true,
  • "fileDesc": "string",
  • "fileAction": "string",
  • "arguments": "string",
  • "properties": {
    },
  • "color": "string",
  • "fontIcon": "string",
  • "creationDate": "2019-08-24T14:15:22Z",
  • "lastUpdate": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
No sample

Get file or package repository items by their IDs.

This endpoint retrieves repository items based on their IDs. It expects a list of repository item IDs (repos) in the request body. The method first checks the user's permissions to ensure proper authorization. It then retrieves the list of repository file metadata. The response contains a JSON array of repository file metadata representing the requested items.

Authorizations:
bearer-key
Request Body schema: application/json
required
Array
string

Responses

Request samples

Content type
application/json
[
  • "string"
]

Response samples

Content type
application/json
No sample

Get a list of repository file (or package) metadata.

This endpoint retrieves a list of repository file metadata. It first checks the user's permissions to ensure proper authorization. The API then retrieve the list of repository file metadata. The response is a JSON array containing information about each file (or package), including details such as file name, size, creation date, and other relevant metadata.

Authorizations:
bearer-key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Triggers APIs

APIs for triggers functions

Save trigger to triggers repository

This API endpoint is used to create or update a trigger repository item. It expects an HTTP POST request with a Trigger object in the request body. The API performs access control checks, executes pre-save operations, and then saves the trigger repository item. If it's a new item, it sets the creation date before saving.

Authorizations:
bearer-key
Request Body schema: application/json
required
triggerId
string
triggerName
string
description
string
domain
string
owner
string
object (TriggerData)
creationDate
string <date-time>
privateRepoItem
boolean
color
string
fontIcon
string

Responses

Request samples

Content type
application/json
{
  • "triggerId": "string",
  • "triggerName": "string",
  • "description": "string",
  • "domain": "string",
  • "owner": "string",
  • "triggerData": {
    },
  • "creationDate": "2019-08-24T14:15:22Z",
  • "privateRepoItem": true,
  • "color": "string",
  • "fontIcon": "string"
}

Response samples

Content type
application/json
No sample

Retrieves all triggers.

This endpoint is used to retrieve all triggers previously stored. The endpoint will return a JSON array containing all triggers in the database. If no triggers are found in the database, the endpoint will return an empty array.

Authorizations:
bearer-key

Responses

Response samples

Content type
application/json
No sample

OTA controller APIs

APIs for controlling OTAs

Save Repository Item

This API endpoint is used to create or update a repository item. It expects an HTTP POST request with a RepositoryItemBase object in the request body. The API performs access control checks, executes pre-save operations, and then saves the repository item. If it's a new item, it sets the creation date before saving.

Authorizations:
bearer-key
Request Body schema: application/json
required
repositoryItemId
string
repositoryItemName
string
repositoryItemDesc
string
domain
string
owner
string
color
string
fontIcon
string
creationDate
string <date-time>
object
privateRepoItem
boolean
url
string
type
string
thumbnail
string
object

Responses

Request samples

Content type
application/json
Example
{
  • "repositoryItemId": "string",
  • "repositoryItemName": "string",
  • "repositoryItemDesc": "string",
  • "domain": "string",
  • "owner": "string",
  • "color": "string",
  • "fontIcon": "string",
  • "creationDate": "2019-08-24T14:15:22Z",
  • "moreData": {
    },
  • "privateRepoItem": true,
  • "url": "string",
  • "type": "string",
  • "thumbnail": "string",
  • "properties": {
    },
  • "@class": "AssetsItem"
}

Response samples

Content type
application/json
No sample

Get all repository items

This endpoint retrieves all repository items. It first checks the access control list (ACL) to ensure that the logged-in user has the necessary permissions abd then returns the list of all repository items.

Authorizations:
bearer-key

Responses

Response samples

Content type
application/json
No sample

support center APIs

APIs for managing support functions

Updates the household ID of the devices in the system.

The API receives a list of DeviceHHID objects which are pairs of device ID and Household ID, and set it in the system.

Authorizations:
bearer-key
Request Body schema: application/json
required
Array
deviceID
string

The device ID which needs to be mapped to the household ID.

hhid
string

The household ID to attach to the device ID.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
No sample

Filters APIs

APIs for filters operations

Add device filter (or group)

This API endpoint allows the addition of a device filter by creating a new DeviceFilter object. It expects an HTTP POST request with a DeviceFilter provided in the request body. The API verifies the logged user's permissions, sets the owner and domain of the filter, and then saves it. It's important to note that a group can be thought of as a specific type of filter that is further refined by tags.

Authorizations:
bearer-key
Request Body schema: application/json
required
id
string

Id of the associated filter

object (FilterNode)
name
string

Filter's name

desc
string

A description of the filter

isGroupFilter
boolean

States if filter is a group filter

owner
string

The owner of the filter

domain
string

Filter's domain

Array of objects (DeviceTag)

A list of the devices tags

color
string

A hex code for the color associated with the filter

icon
string

Icon for the filter

schoolFilter
boolean

Flag stating if the filter is a school filter

syncedFromGoogle
boolean

flag stating if the filter is synced from Google

classroomID
integer <int64>

Id for the classroom associated with the filter

object

HashMap for the current classroom room

password
string

password for the filter

object

HashMap stating different properties of the filter

packages
Array of strings

Filter's packages

profileID
string
profilesList
Array of strings

Filter's list of profiles id

packagesRepoItems
Array of strings
Array of objects (DevicePolicyData)

profiles associated with the filter

private
boolean
groupFilter
boolean
permanent
boolean

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "rootNode": {
    },
  • "name": "string",
  • "desc": "string",
  • "isGroupFilter": true,
  • "owner": "string",
  • "domain": "string",
  • "deviceTagList": [
    ],
  • "color": "string",
  • "icon": "string",
  • "schoolFilter": true,
  • "syncedFromGoogle": true,
  • "classroomID": 0,
  • "currentRoom": {
    },
  • "password": "string",
  • "properties": {
    },
  • "packages": [
    ],
  • "profileID": "string",
  • "profilesList": [
    ],
  • "packagesRepoItems": [
    ],
  • "profiles": [
    ],
  • "private": true,
  • "groupFilter": true,
  • "permanent": true
}

Response samples

Content type
application/json
No sample

Retrieves a list of device filters (or groups).

This endpoint allows authorized users to retrieve a list of device filters and groups.

Authorizations:
bearer-key

Responses

Response samples

Content type
application/json
[
  • {
    }
]