Skip to main content

Devices Actions

https://api.losant.com/applications/APPLICATION_ID/devices

Below are the various requests that can be performed against the Devices resource, as well as the expected parameters and the potential responses.

Attribute Names

Gets the attribute names that match the given query. Maximum 1K returned.

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/devices/attributeNames

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.attributeNames.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
queryNDevice filter JSON object. See Advanced Device Query for more details.query={"$or":[{"name":{"$ne":"myValue"}},{"parentId":"575ec8687ae143cd83dc4a97"}]}
dataTypeNFilter the devices by the given attribute data type or types. See Device Attribute Data Type Filter for more details.dataType[0]=number&dataType[1]=blob
startsWithNFilter attributes down to those that have names starting with the given string. Case insensitive.startsWith=temper

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/devices/attributeNames

Successful Responses

CodeTypeDescription
200Attribute Names ResponseThe matching attribute names

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Delete

Delete devices

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices/delete

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, devices.*, or devices.delete.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Devices Delete Or Restore Post schema. For example, the following would be a valid body for this request:

{
"query": {
"name": {
"$ne": "My Device"
}
},
"email": "email@example.com"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"query":{"name":{"$ne":"My Device"}},"email":"email@example.com"}' \
https://api.losant.com/applications/APPLICATION_ID/devices/delete

Successful Responses

CodeTypeDescription
200Bulk Deletion ResponseObject indicating number of devices deleted or failed
202Job Enqueued API ResultIf a job was enqueued for the devices to be deleted

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Device Names

Gets the device names that match the given query. Maximum 1K returned.

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/devices/deviceNames

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.deviceNames.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
queryNDevice filter JSON object. See Advanced Device Query for more details.query={"$or":[{"name":{"$ne":"myValue"}},{"parentId":"575ec8687ae143cd83dc4a97"}]}
startsWithNFilter devices down to those that have names starting with the given string. Case insensitive.startsWith=temper

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/devices/deviceNames

Successful Responses

CodeTypeDescription
200Device Names ResponseThe matching device names

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Export

Creates an export of all device metadata

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices/export

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.export.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
emailNEmail address to send export to. Defaults to current user's email.email=email@example.com
callbackUrlNCallback URL to call with export resultcallbackUrl=https://example.com/cburl

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Devices Metadata Export Post schema. For example, the following would be a valid body for this request:

{
"query": {
"name": {
"$ne": "My Device"
}
},
"email": "email@example.com"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
https://api.losant.com/applications/APPLICATION_ID/devices/export

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultIf generation of export was successfully started

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Get

Returns the devices for an application

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/devices

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.get.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
sortFieldNField to sort the results by. Accepted values are: name, id, creationDate, lastUpdated, connectionStatus, deletedAtnamesortField=name
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page100perPage=10
filterFieldNField to filter the results by. Blank or not provided means no filtering. Accepted values are: namefilterField=name
filterNFilter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.filter=my * device
deviceClassNFilter the devices by the given device class or classes. See Device Class Filter for more details.deviceClass[0]=standalone&deviceClass[1]=edgeCompute
tagFilterNArray of tag pairs to filter by. See Device Tag Filter for more details.tagFilter[0][key]=Floor&tagFilter[0][value]=2&tagFilter[1][key]=Serial
excludeConnectionInfoNIf set, do not return connection infoexcludeConnectionInfo=true
parentIdNFilter devices as children of a given system idparentId=575ecf887ae143cd83dc4aa2
queryNDevice filter JSON object which overrides the filterField, filter, deviceClass, tagFilter, and parentId parameters. See Advanced Device Query for more details.query={"$or":[{"name":{"$ne":"myValue"}},{"parentId":"575ec8687ae143cd83dc4a97"}]}
tagsAsObjectNReturn tags as an object map instead of an arraytagsAsObject=true
attributesAsObjectNReturn attributes as an object map instead of an arrayattributesAsObject=false
queryDeletedNIf true, endpoint will return recently deleted devices insteadqueryDeleted=false

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/devices

Successful Responses

CodeTypeDescription
200DevicesCollection of devices

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Get Composite State

Retrieve the composite last complete state of the matching devices

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/devices/compositeState

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.getCompositeState.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of time range to look at to build composite state1start=1465790400000
endNEnd of time range to look at to build composite state0end=1465790400000
attributesNComma-separated list of attributes to include. When not provided, returns all attributes.attributes=myAttr1,myAttr2
sortFieldNField to sort the results by. Accepted values are: name, id, creationDate, lastUpdated, connectionStatusnamesortField=name
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page100perPage=10
queryNDevice advanced query JSON object. See Advanced Device Query for more details.query={"$or":[{"name":{"$ne":"myValue"}},{"parentId":"575ec8687ae143cd83dc4a97"}]}

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/devices/compositeState

Successful Responses

CodeTypeDescription
200Devices Composite StateCollection of composite last state of the devices

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Patch

Update the fields of one or more devices

Method And Url

PATCH https://api.losant.com/applications/APPLICATION_ID/devices

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, devices.*, or devices.patch.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Devices Patch schema. For example, the following would be a valid body for this request:

{
"updateFields": {
"name": "My Updated Device",
"description": "Description of my updated device",
"tags": [
{
"key": "TagKey",
"value": "TagValue"
}
],
"attributes": [
{
"name": "voltage",
"dataType": "number"
}
],
"deviceClass": "standalone"
},
"deviceIds": [
"575ecec57ae143cd83dc4a9f",
"575ecec57ae143cd83dc4a9e",
"575ecec57ae143cd83dc4a9a"
]
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"updateFields":{"name":"My Updated Device","description":"Description of my updated device","tags":[{"key":"TagKey","value":"TagValue"}],"attributes":[{"name":"voltage","dataType":"number"}],"deviceClass":"standalone"},"deviceIds":["575ecec57ae143cd83dc4a9f","575ecec57ae143cd83dc4a9e","575ecec57ae143cd83dc4a9a"]}' \
https://api.losant.com/applications/APPLICATION_ID/devices

Successful Responses

CodeTypeDescription
200Devices UpdatedObject including an update log link and the number of devices updated, failed, and skipped
202Job Enqueued API ResultSuccessfully queued bulk update job

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Payload Counts

Creates an export of payload count information for the matching devices

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices/payloadCounts

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.payloadCounts.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Devices Payload Count Export Post schema. For example, the following would be a valid body for this request:

{
"query": {
"name": {
"$ne": "My Device"
}
},
"email": "email@example.com"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
https://api.losant.com/applications/APPLICATION_ID/devices/payloadCounts

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultIf generation of export was successfully started

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Post

Create a new device for an application

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, devices.*, or devices.post.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
tagsAsObjectNReturn tags as an object map instead of an arraytagsAsObject=true
attributesAsObjectNReturn attributes as an object map instead of an arrayattributesAsObject=false

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Device Post schema. For example, the following would be a valid body for this request:

{
"name": "My New Device",
"description": "Description of my new device",
"tags": [
{
"key": "TagKey",
"value": "TagValue"
}
],
"attributes": [
{
"name": "voltage",
"dataType": "number"
}
],
"deviceClass": "standalone"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"name":"My New Device","description":"Description of my new device","tags":[{"key":"TagKey","value":"TagValue"}],"attributes":[{"name":"voltage","dataType":"number"}],"deviceClass":"standalone"}' \
https://api.losant.com/applications/APPLICATION_ID/devices

Successful Responses

CodeTypeDescription
201DeviceSuccessfully created device

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Remove Data

Removes all device data for the specified time range. Defaults to all data.

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices/removeData

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, devices.*, or devices.removeData.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Devices Remove Data Post schema. For example, the following would be a valid body for this request:

{
"query": {
"name": {
"$ne": "My Device"
}
},
"start": 1,
"end": 0,
"attributes": [
"deleteMyData",
"mineToo"
]
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"query":{"name":{"$ne":"My Device"}},"start":1,"end":0,"attributes":["deleteMyData","mineToo"]}' \
https://api.losant.com/applications/APPLICATION_ID/devices/removeData

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultIf a job was enqueued for device data to be removed

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Restore

Restore deleted devices

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices/restore

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Organization, all.User, devices.*, or devices.restore.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Devices Delete Or Restore Post schema. For example, the following would be a valid body for this request:

{
"query": {
"name": {
"$ne": "My Device"
}
},
"email": "email@example.com"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"query":{"name":{"$ne":"My Device"}},"email":"email@example.com"}' \
https://api.losant.com/applications/APPLICATION_ID/devices/restore

Successful Responses

CodeTypeDescription
200Bulk Restoration ResponseObject indicating number of devices restored or failed
202Job Enqueued API ResultIf a job was enqueued for the devices to be restored

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Send Command

Send a command to multiple devices

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/devices/command

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Device, all.Organization, all.User, devices.*, or devices.sendCommand.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Multi Device Command schema. For example, the following would be a valid body for this request:

{
"time": "2016-06-13T04:00:00.000Z",
"name": "myCommand",
"payload": [
1,
1,
2,
3,
5
],
"deviceTags": [
{
"key": "floor",
"value": "8"
}
]
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"time":"2016-06-13T04:00:00.000Z","name":"myCommand","payload":[1,1,2,3,5],"deviceTags":[{"key":"floor","value":"8"}]}' \
https://api.losant.com/applications/APPLICATION_ID/devices/command

Successful Responses

CodeTypeDescription
200SuccessIf command was successfully sent
202Job Enqueued API ResultIf command was queued to be sent

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Tag Keys

Gets the unique tag keys for devices that match the given query. Maximum 1K returned.

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/devices/tagKeys

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.tagKeys.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
queryNDevice filter JSON object. See Advanced Device Query for more details.query={"$or":[{"name":{"$ne":"myValue"}},{"parentId":"575ec8687ae143cd83dc4a97"}]}
startsWithNFilter keys down to those that start with the given string. Case insensitive.startsWith=temper

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/devices/tagKeys

Successful Responses

CodeTypeDescription
200Tag Keys ResponseThe matching tag keys

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Tag Values

Gets the unique tag values for the given key for devices that match the given query. Maximum 1K returned.

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/devices/tagValues

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.tagValues.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
queryNDevice filter JSON object. See Advanced Device Query for more details.query={"$or":[{"name":{"$ne":"myValue"}},{"parentId":"575ec8687ae143cd83dc4a97"}]}
keyYThe tag key to get the values forkey=myKey
startsWithNFilter values down to those that start with the given string. Case insensitive.startsWith=temper

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/applications/APPLICATION_ID/devices/tagValues?key=myKey

Successful Responses

CodeTypeDescription
200Tag Values ResponseThe matching tag values

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application was not found

Schemas

Advanced Device Query

Schema for advanced device queries

Advanced Device Query Schema

  • {} 4 keys
    • "http://json-schema.org/draft-07/schema#"
    • "object"
    • {} 19 keys
      • {} 3 keys
        • {} 3 keys
          • {} 3 keys
            • {} 1 key
              • {} 1 key
                • {} 1 key
                  • {} 1 key
                    • {} 1 key
                      • {} 1 key
                        • {} 1 key
                          • {} 1 key
                            • {} 1 key
                              • {} 1 key
                                • {} 1 key
                                  • {} 1 key
                                    • {} 1 key
                                      • {} 1 key
                                        • {} 1 key
                                          • {} 1 key
                                          • false

                                        Advanced Device Query Example

                                        • {} 1 key
                                          • [] 2 items

                                          Attribute Names Response

                                          Schema for a list of attribute names

                                          Attribute Names Response Schema

                                          • {} 3 keys
                                            • "http://json-schema.org/draft-07/schema#"
                                            • "object"
                                            • {} 1 key
                                              • {} 3 keys

                                            Attribute Names Response Example

                                            • {} 1 key
                                              • [] 3 items

                                              Bulk Deletion Response

                                              Schema for the response to a bulk deletion

                                              Bulk Deletion Response Schema

                                              • {} 3 keys
                                                • "http://json-schema.org/draft-07/schema#"
                                                • "object"
                                                • {} 2 keys
                                                  • {} 1 key
                                                    • {} 1 key

                                                  Bulk Deletion Response Example

                                                  • {} 1 key
                                                    • 3

                                                  Bulk Restoration Response

                                                  Schema for the response to a bulk restore request

                                                  Bulk Restoration Response Schema

                                                  • {} 3 keys
                                                    • "http://json-schema.org/draft-07/schema#"
                                                    • "object"
                                                    • {} 2 keys
                                                      • {} 1 key
                                                        • {} 1 key

                                                      Bulk Restoration Response Example

                                                      • {} 1 key
                                                        • 3

                                                      Devices Composite State

                                                      Schema for a collection of Composite Device State

                                                      Devices Composite State Schema

                                                      • {} 3 keys
                                                        • "http://json-schema.org/draft-07/schema#"
                                                        • "object"
                                                        • {} 9 keys
                                                          • {} 2 keys
                                                            • {} 1 key
                                                              • {} 1 key
                                                                • {} 1 key
                                                                  • {} 1 key
                                                                    • {} 1 key
                                                                      • {} 2 keys
                                                                        • {} 2 keys
                                                                          • {} 1 key

                                                                        Devices Composite State Example

                                                                        • {} 8 keys
                                                                          • [] 1 item
                                                                            • 1
                                                                            • 4
                                                                            • 1
                                                                            • 0
                                                                            • "name"
                                                                            • "asc"
                                                                            • "575ec8687ae143cd83dc4a97"

                                                                          Device

                                                                          Schema for a single Device

                                                                          Device Schema

                                                                          • {} 3 keys
                                                                            • "http://json-schema.org/draft-07/schema#"
                                                                            • "object"
                                                                            • {} 18 keys
                                                                              • {} 2 keys
                                                                                • {} 2 keys
                                                                                  • {} 2 keys
                                                                                    • {} 2 keys
                                                                                      • {} 2 keys
                                                                                        • {} 2 keys
                                                                                          • {} 3 keys
                                                                                            • {} 2 keys
                                                                                              • {} 3 keys
                                                                                                • {} 3 keys
                                                                                                  • {} 2 keys
                                                                                                    • {} 2 keys
                                                                                                      • {} 2 keys
                                                                                                        • {} 2 keys
                                                                                                          • {} 1 key
                                                                                                            • {} 3 keys
                                                                                                              • {} 3 keys
                                                                                                                • {} 1 key

                                                                                                              Device Example

                                                                                                              • {} 12 keys
                                                                                                                • "575ecf887ae143cd83dc4aa2"
                                                                                                                • "575ecf887ae143cd83dc4aa2"
                                                                                                                • "575ec8687ae143cd83dc4a97"
                                                                                                                • "2016-06-13T04:00:00.000Z"
                                                                                                                • "2016-06-13T04:00:00.000Z"
                                                                                                                • "My Device"
                                                                                                                • "A device description"
                                                                                                                • [] 2 items
                                                                                                                  • [] 1 item
                                                                                                                    • "5d8a0da7ce2f3d37c205d0c5"
                                                                                                                    • "standalone"
                                                                                                                    • {} 2 keys

                                                                                                                    Device Attribute Data Type Filter

                                                                                                                    Select one or multiple device attribute data types

                                                                                                                    Device Attribute Data Type Filter Schema

                                                                                                                    • {} 2 keys
                                                                                                                      • "http://json-schema.org/draft-07/schema#"
                                                                                                                      • [] 2 items

                                                                                                                      Device Attribute Data Type Filter Example

                                                                                                                      • [] 2 items
                                                                                                                        • "number"
                                                                                                                        • "blob"

                                                                                                                      Device Class Filter

                                                                                                                      Select one or multiple device classes

                                                                                                                      Device Class Filter Schema

                                                                                                                      • {} 2 keys
                                                                                                                        • "http://json-schema.org/draft-07/schema#"
                                                                                                                        • [] 2 items

                                                                                                                        Device Class Filter Example

                                                                                                                        • [] 2 items
                                                                                                                          • "standalone"
                                                                                                                          • "edgeCompute"

                                                                                                                        Device Names Response

                                                                                                                        Schema for a list of device names

                                                                                                                        Device Names Response Schema

                                                                                                                        • {} 3 keys
                                                                                                                          • "http://json-schema.org/draft-07/schema#"
                                                                                                                          • "object"
                                                                                                                          • {} 1 key
                                                                                                                            • {} 3 keys

                                                                                                                          Device Names Response Example

                                                                                                                          • {} 1 key
                                                                                                                            • [] 1 item

                                                                                                                            Device Post

                                                                                                                            Schema for the body of a Device creation request

                                                                                                                            Device Post Schema

                                                                                                                            • {} 5 keys
                                                                                                                              • "http://json-schema.org/draft-07/schema#"
                                                                                                                              • "object"
                                                                                                                              • {} 9 keys
                                                                                                                                • {} 3 keys
                                                                                                                                  • {} 2 keys
                                                                                                                                    • {} 3 keys
                                                                                                                                      • {} 3 keys
                                                                                                                                        • {} 2 keys
                                                                                                                                          • {} 2 keys
                                                                                                                                            • {} 1 key
                                                                                                                                              • {} 3 keys
                                                                                                                                                • {} 1 key
                                                                                                                                                • false
                                                                                                                                                • [] 1 item

                                                                                                                                                Device Post Example

                                                                                                                                                • {} 5 keys
                                                                                                                                                  • "My New Device"
                                                                                                                                                  • "Description of my new device"
                                                                                                                                                  • [] 1 item
                                                                                                                                                    • [] 1 item
                                                                                                                                                      • "standalone"

                                                                                                                                                    Device Tag Filter

                                                                                                                                                    Array of Tags for filtering devices. Tag keys and tag values are optional.

                                                                                                                                                    Device Tag Filter Schema

                                                                                                                                                    • {} 4 keys
                                                                                                                                                      • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                      • "array"
                                                                                                                                                      • {} 3 keys
                                                                                                                                                        • 100

                                                                                                                                                      Device Tag Filter Example

                                                                                                                                                      • [] 2 items
                                                                                                                                                        • {} 2 keys
                                                                                                                                                          • {} 1 key

                                                                                                                                                          Devices

                                                                                                                                                          Schema for a collection of Devices

                                                                                                                                                          Devices Schema

                                                                                                                                                          • {} 3 keys
                                                                                                                                                            • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                            • "object"
                                                                                                                                                            • {} 14 keys
                                                                                                                                                              • {} 2 keys
                                                                                                                                                                • {} 1 key
                                                                                                                                                                  • {} 1 key
                                                                                                                                                                    • {} 1 key
                                                                                                                                                                      • {} 1 key
                                                                                                                                                                        • {} 1 key
                                                                                                                                                                          • {} 1 key
                                                                                                                                                                            • {} 1 key
                                                                                                                                                                              • {} 2 keys
                                                                                                                                                                                • {} 2 keys
                                                                                                                                                                                  • {} 2 keys
                                                                                                                                                                                    • {} 5 keys
                                                                                                                                                                                      • {} 1 key
                                                                                                                                                                                        • {} 1 key

                                                                                                                                                                                      Devices Example

                                                                                                                                                                                      • {} 8 keys
                                                                                                                                                                                        • [] 1 item
                                                                                                                                                                                          • 1
                                                                                                                                                                                          • 4
                                                                                                                                                                                          • 1
                                                                                                                                                                                          • 0
                                                                                                                                                                                          • "name"
                                                                                                                                                                                          • "asc"
                                                                                                                                                                                          • "575ec8687ae143cd83dc4a97"

                                                                                                                                                                                        Devices Delete Or Restore Post

                                                                                                                                                                                        Schema for the body of a bulk device deletion or restoration request

                                                                                                                                                                                        Devices Delete Or Restore Post Schema

                                                                                                                                                                                        • {} 5 keys
                                                                                                                                                                                          • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                          • "object"
                                                                                                                                                                                          • {} 4 keys
                                                                                                                                                                                            • {} 3 keys
                                                                                                                                                                                              • {} 5 keys
                                                                                                                                                                                                • {} 3 keys
                                                                                                                                                                                                  • {} 2 keys
                                                                                                                                                                                                  • false
                                                                                                                                                                                                  • [] 1 item

                                                                                                                                                                                                  Devices Delete Or Restore Post Example

                                                                                                                                                                                                  • {} 2 keys
                                                                                                                                                                                                    • {} 1 key
                                                                                                                                                                                                      • "email@example.com"

                                                                                                                                                                                                    Devices Payload Count Export Post

                                                                                                                                                                                                    Schema for the body of a device payload count export request

                                                                                                                                                                                                    Devices Payload Count Export Post Schema

                                                                                                                                                                                                    • {} 4 keys
                                                                                                                                                                                                      • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                      • "object"
                                                                                                                                                                                                      • {} 5 keys
                                                                                                                                                                                                        • {} 3 keys
                                                                                                                                                                                                          • {} 3 keys
                                                                                                                                                                                                            • {} 5 keys
                                                                                                                                                                                                              • {} 1 key
                                                                                                                                                                                                                • {} 1 key
                                                                                                                                                                                                                • false

                                                                                                                                                                                                              Devices Payload Count Export Post Example

                                                                                                                                                                                                              • {} 2 keys
                                                                                                                                                                                                                • {} 1 key
                                                                                                                                                                                                                  • "email@example.com"

                                                                                                                                                                                                                Devices Metadata Export Post

                                                                                                                                                                                                                Schema for the body of a device metadata export request

                                                                                                                                                                                                                Devices Metadata Export Post Schema

                                                                                                                                                                                                                • {} 4 keys
                                                                                                                                                                                                                  • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                  • "object"
                                                                                                                                                                                                                  • {} 4 keys
                                                                                                                                                                                                                    • {} 3 keys
                                                                                                                                                                                                                      • {} 3 keys
                                                                                                                                                                                                                        • {} 5 keys
                                                                                                                                                                                                                          • {} 3 keys
                                                                                                                                                                                                                          • false

                                                                                                                                                                                                                        Devices Metadata Export Post Example

                                                                                                                                                                                                                        • {} 2 keys
                                                                                                                                                                                                                          • {} 1 key
                                                                                                                                                                                                                            • "email@example.com"

                                                                                                                                                                                                                          Devices Patch

                                                                                                                                                                                                                          Schema for the body of a Devices modification request

                                                                                                                                                                                                                          Devices Patch Schema

                                                                                                                                                                                                                          • {} 5 keys
                                                                                                                                                                                                                            • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                            • "object"
                                                                                                                                                                                                                            • {} 6 keys
                                                                                                                                                                                                                              • {} 5 keys
                                                                                                                                                                                                                                • {} 3 keys
                                                                                                                                                                                                                                  • {} 5 keys
                                                                                                                                                                                                                                    • {} 3 keys
                                                                                                                                                                                                                                      • {} 3 keys
                                                                                                                                                                                                                                        • {} 3 keys
                                                                                                                                                                                                                                        • false
                                                                                                                                                                                                                                        • [] 0 items

                                                                                                                                                                                                                                        Devices Patch Example

                                                                                                                                                                                                                                        • {} 2 keys
                                                                                                                                                                                                                                          • {} 5 keys
                                                                                                                                                                                                                                            • [] 3 items

                                                                                                                                                                                                                                            Devices Remove Data Post

                                                                                                                                                                                                                                            Schema for the body of a bulk data removal request

                                                                                                                                                                                                                                            Devices Remove Data Post Schema

                                                                                                                                                                                                                                            • {} 5 keys
                                                                                                                                                                                                                                              • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                              • "object"
                                                                                                                                                                                                                                              • {} 8 keys
                                                                                                                                                                                                                                                • {} 5 keys
                                                                                                                                                                                                                                                  • {} 1 key
                                                                                                                                                                                                                                                    • {} 1 key
                                                                                                                                                                                                                                                      • {} 1 key
                                                                                                                                                                                                                                                        • {} 1 key
                                                                                                                                                                                                                                                          • {} 1 key
                                                                                                                                                                                                                                                            • {} 3 keys
                                                                                                                                                                                                                                                              • {} 3 keys
                                                                                                                                                                                                                                                              • false
                                                                                                                                                                                                                                                              • [] 1 item

                                                                                                                                                                                                                                                              Devices Remove Data Post Example

                                                                                                                                                                                                                                                              • {} 4 keys
                                                                                                                                                                                                                                                                • {} 1 key
                                                                                                                                                                                                                                                                  • 1
                                                                                                                                                                                                                                                                  • 0
                                                                                                                                                                                                                                                                  • [] 2 items

                                                                                                                                                                                                                                                                  Devices Updated

                                                                                                                                                                                                                                                                  Schema for response of devices updated if under 100 devices queried

                                                                                                                                                                                                                                                                  Devices Updated Schema

                                                                                                                                                                                                                                                                  • {} 3 keys
                                                                                                                                                                                                                                                                    • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                    • "object"
                                                                                                                                                                                                                                                                    • {} 4 keys
                                                                                                                                                                                                                                                                      • {} 1 key
                                                                                                                                                                                                                                                                        • {} 1 key
                                                                                                                                                                                                                                                                          • {} 1 key
                                                                                                                                                                                                                                                                            • {} 1 key

                                                                                                                                                                                                                                                                          Devices Updated Example

                                                                                                                                                                                                                                                                          • {} 4 keys
                                                                                                                                                                                                                                                                            • 3
                                                                                                                                                                                                                                                                            • 0
                                                                                                                                                                                                                                                                            • 2
                                                                                                                                                                                                                                                                            • "https://example.com/log-link"

                                                                                                                                                                                                                                                                          Error

                                                                                                                                                                                                                                                                          Schema for errors returned by the API

                                                                                                                                                                                                                                                                          Error Schema

                                                                                                                                                                                                                                                                          • {} 3 keys
                                                                                                                                                                                                                                                                            • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                            • "object"
                                                                                                                                                                                                                                                                            • {} 2 keys
                                                                                                                                                                                                                                                                              • {} 1 key
                                                                                                                                                                                                                                                                                • {} 1 key

                                                                                                                                                                                                                                                                              Error Example

                                                                                                                                                                                                                                                                              • {} 2 keys
                                                                                                                                                                                                                                                                                • "NotFound"
                                                                                                                                                                                                                                                                                • "Application was not found"

                                                                                                                                                                                                                                                                              Job Enqueued API Result

                                                                                                                                                                                                                                                                              Schema for the result of a job being queued

                                                                                                                                                                                                                                                                              Job Enqueued API Result Schema

                                                                                                                                                                                                                                                                              • {} 3 keys
                                                                                                                                                                                                                                                                                • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                                • "object"
                                                                                                                                                                                                                                                                                • {} 3 keys
                                                                                                                                                                                                                                                                                  • {} 2 keys
                                                                                                                                                                                                                                                                                    • {} 2 keys
                                                                                                                                                                                                                                                                                      • {} 2 keys

                                                                                                                                                                                                                                                                                    Job Enqueued API Result Example

                                                                                                                                                                                                                                                                                    • {} 3 keys
                                                                                                                                                                                                                                                                                      • true
                                                                                                                                                                                                                                                                                      • "clnHvJbyVkOWAZwYAwLP4"
                                                                                                                                                                                                                                                                                      • true

                                                                                                                                                                                                                                                                                    Multi Device Command

                                                                                                                                                                                                                                                                                    Schema for the body of a request to send a command to multiple Devices

                                                                                                                                                                                                                                                                                    Multi Device Command Schema

                                                                                                                                                                                                                                                                                    • {} 5 keys
                                                                                                                                                                                                                                                                                      • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                                      • "object"
                                                                                                                                                                                                                                                                                      • {} 6 keys
                                                                                                                                                                                                                                                                                        • {} 1 key
                                                                                                                                                                                                                                                                                          • {} 3 keys
                                                                                                                                                                                                                                                                                            • {} 0 keys
                                                                                                                                                                                                                                                                                              • {} 3 keys
                                                                                                                                                                                                                                                                                                • {} 3 keys
                                                                                                                                                                                                                                                                                                  • {} 5 keys
                                                                                                                                                                                                                                                                                                  • [] 1 item
                                                                                                                                                                                                                                                                                                    • false

                                                                                                                                                                                                                                                                                                  Multi Device Command Example

                                                                                                                                                                                                                                                                                                  • {} 4 keys
                                                                                                                                                                                                                                                                                                    • "2016-06-13T04:00:00.000Z"
                                                                                                                                                                                                                                                                                                    • "myCommand"
                                                                                                                                                                                                                                                                                                    • [] 5 items
                                                                                                                                                                                                                                                                                                      • [] 1 item

                                                                                                                                                                                                                                                                                                      Success

                                                                                                                                                                                                                                                                                                      Schema for reporting a successful operation

                                                                                                                                                                                                                                                                                                      Success Schema

                                                                                                                                                                                                                                                                                                      • {} 3 keys
                                                                                                                                                                                                                                                                                                        • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                                                        • "object"
                                                                                                                                                                                                                                                                                                        • {} 1 key
                                                                                                                                                                                                                                                                                                          • {} 2 keys

                                                                                                                                                                                                                                                                                                        Success Example

                                                                                                                                                                                                                                                                                                        • {} 1 key
                                                                                                                                                                                                                                                                                                          • true

                                                                                                                                                                                                                                                                                                        Tag Keys Response

                                                                                                                                                                                                                                                                                                        Schema for a list of tag keys

                                                                                                                                                                                                                                                                                                        Tag Keys Response Schema

                                                                                                                                                                                                                                                                                                        • {} 3 keys
                                                                                                                                                                                                                                                                                                          • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                                                          • "object"
                                                                                                                                                                                                                                                                                                          • {} 1 key
                                                                                                                                                                                                                                                                                                            • {} 3 keys

                                                                                                                                                                                                                                                                                                          Tag Keys Response Example

                                                                                                                                                                                                                                                                                                          • {} 1 key
                                                                                                                                                                                                                                                                                                            • [] 3 items

                                                                                                                                                                                                                                                                                                            Tag Values Response

                                                                                                                                                                                                                                                                                                            Schema for a list of tag values for a key

                                                                                                                                                                                                                                                                                                            Tag Values Response Schema

                                                                                                                                                                                                                                                                                                            • {} 3 keys
                                                                                                                                                                                                                                                                                                              • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                                                                                                                                                              • "object"
                                                                                                                                                                                                                                                                                                              • {} 2 keys
                                                                                                                                                                                                                                                                                                                • {} 2 keys
                                                                                                                                                                                                                                                                                                                  • {} 3 keys

                                                                                                                                                                                                                                                                                                                Tag Values Response Example

                                                                                                                                                                                                                                                                                                                • {} 2 keys
                                                                                                                                                                                                                                                                                                                  • "key1"
                                                                                                                                                                                                                                                                                                                  • [] 3 items

                                                                                                                                                                                                                                                                                                                  Was this page helpful?


                                                                                                                                                                                                                                                                                                                  Still looking for help? You can also search the Losant Forums or submit your question there.