Skip to main content

Application Actions

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

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

Apply Template

Add resources to an application via an application template

Method And Url

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

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, application.*, or application.applyTemplate.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated 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 Application Apply Template Patch Schema schema. For example, the following would be a valid body for this request:

{
"templateId": "575ec8687ae143cd83dc4a97",
"email": "email@example.com"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"templateId":"575ec8687ae143cd83dc4a97","email":"email@example.com"}' \
https://api.losant.com/applications/APPLICATION_ID/applyTemplate

Successful Responses

CodeTypeDescription
200ApplicationUpdated application information
202Job Enqueued API ResultIf a job was enqueued for the resources to be imported into the application

Error Responses

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

Archive Data

Returns success when a job has been enqueued to archive this application's device data for a given day

Method And Url

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

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, application.*, or application.archiveData.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
dateYThe date to archive data (ms since epoch), it must be within the archive time range older than 31 days and newer than the organizations dataTTLdate=1518556791829

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/archiveData?date=1518556791829

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultEnqueued a job to archive this applications device data

Error Responses

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

Backfill Archive Data

Returns success when a job has been enqueued to backfill all current data to its archive

Method And Url

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

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, application.*, or application.backfillArchiveData.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

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/backfillArchiveData

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultEnqueued a job to backfill device data to this application archive location

Error Responses

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

Clone

Copy an application into a new application

Method And Url

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

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, application.*, or application.clone.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated 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 Application Clone Post Schema schema. For example, the following would be a valid body for this request:

{
"includeFiles": true,
"includeDevices": true,
"ownerType": "organization",
"ownerId": "575ec8687ae143cd83dc4a98"
}

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/clone

Successful Responses

CodeTypeDescription
200Success Dry Runif dryRun is set and successful, then return success
201Application Creation By Template ResultIf application was successfully cloned
202Job Enqueued API ResultIf application was enqueued to be cloned

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application is not found
422Validation ErrorError if too many validation errors occurred on other resources

Delete

Deletes an application

Method And Url

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

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, application.*, or application.delete.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

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 DELETE \
https://api.losant.com/applications/APPLICATION_ID

Successful Responses

CodeTypeDescription
200SuccessIf application was successfully deleted

Error Responses

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

Device Counts

Returns device counts by day for the time range specified for this application

Method And Url

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

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, application.*, or application.deviceCounts.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for device count query (ms since epoch)start=0
endNEnd of range for device count query (ms since epoch)end=1465790400000

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/deviceCounts

Successful Responses

CodeTypeDescription
200Device CountsDevice counts by day

Error Responses

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

Export

Export an application and all of its resources

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/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.Organization, all.User, application.*, or application.export.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated 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 Application Export Post Schema schema. For example, the following would be a valid body for this request:

{
"includeFiles": true,
"includeDevices": true,
"email": "test@example.com"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"includeFiles":true,"includeDevices":true,"email":"test@example.com"}' \
https://api.losant.com/applications/APPLICATION_ID/export

Successful Responses

CodeTypeDescription
200Application Export Resulta url to download the zip of exported resources
202Job Enqueued API ResultIf application was enqueued to be exported

Error Responses

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

Full Data Tables Archive

Returns success when a job has been enqueued to archive all selected data tables

Method And Url

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

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, application.*, or application.fullDataTablesArchive.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

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/fullDataTablesArchive

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultEnqueued a job to archive all selected data tables of this application archive location

Error Responses

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

Full Events Archive

Returns success when a job has been enqueued to archive all current events

Method And Url

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

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, application.*, or application.fullEventsArchive.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

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/fullEventsArchive

Successful Responses

CodeTypeDescription
202Job Enqueued API ResultEnqueued a job to archive all events to this application archive location

Error Responses

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

Get

Retrieves information on an application

Method And Url

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

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.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
summaryExcludeNComma-separated list of summary fields to exclude from application summarysummaryExclude=payloadCount
summaryIncludeNComma-separated list of summary fields to include in application summarysummaryInclude=payloadCount

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

Successful Responses

CodeTypeDescription
200ApplicationApplication information

Error Responses

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

Globals

Updates an application global at the given key

Method And Url

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

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.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated 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 Application Global Patch schema. For example, the following would be a valid body for this request:

[
{
"key": "keyHere",
"description": "Description of my application global",
"json": "\"my json data here\"",
"cloudOnly": true
},
{
"key": "anotherKey",
"json": "\"more json\"",
"cloudOnly": false
}
]

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '[{"key":"keyHere","description":"Description of my application global","json":"\"my json data here\"","cloudOnly":true},{"key":"anotherKey","json":"\"more json\"","cloudOnly":false}]' \
https://api.losant.com/applications/APPLICATION_ID/globals

Successful Responses

CodeTypeDescription
200ApplicationUpdated application information

Error Responses

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

Import

Add multiple resources to an application via a zip file

Method And Url

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

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, application.*, or application.import.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be a multipart form data post containing the following:

NameRequiredDescriptionDefaultExample
importBundleNThe zip file containing all of the resources to import into the application``
emailNEmail address to notify the user when the job to import the application resources has completed or errored, defaults to the email address of the user making the requestemail=email@example.com
optionsNAdditional import options. See Application Import Options for more details.options={"importUrl":"https://storage.example.com/myZipFile.zip","include":["Flow","Device"]}

Curl Example

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

Successful Responses

CodeTypeDescription
200ApplicationUpdated application information
202Job Enqueued API ResultIf a job was enqueued for the resources to be imported into the application

Error Responses

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

Import Logs

Retrieves information on application import logs

Method And Url

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

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, application.*, or application.importLogs.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
limitNMax log entries to return (ordered by time descending)1limit=10
sinceNLook for log entries since this time (ms since epoch)since=1465790400000

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/importLogs

Successful Responses

CodeTypeDescription
200Application Import ExecutionsApplication log objects

Error Responses

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

Mqtt Publish Message

Publishes the given message to the given MQTT topic

Method And Url

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

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, application.*, or application.mqttPublishMessage.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated 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 MQTT Publish Body schema. For example, the following would be a valid body for this request:

{
"topic": "an/mqtt/topic",
"message": "The MQTT message!"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"topic":"an/mqtt/topic","message":"The MQTT message!"}' \
https://api.losant.com/applications/APPLICATION_ID/mqttPublishMessage

Successful Responses

CodeTypeDescription
200SuccessMessage successfully published

Error Responses

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

Mqtt Subscription Stream

Attach to a real time stream of state messages for the given MQTT topic using Server Sent Events (SSE)

Method And Url

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

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, application.*, or application.mqttSubscriptionStream.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
keepAliveIntervalNNumber of seconds between keepalive messages2keepAliveInterval=2
topicYThe MQTT topic to subscribe totopic=my/topic

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/mqttSubscriptionStream?topic=my%2Ftopic

SSE Stream for a Successful Response

SSE stream of mqtt messages for the requested topic

SSE Event NameTypeDescription
mqttMessageMQTT Publish BodyAn SSE event representing a single mqtt payload

Error Responses

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

Notebook Minute Counts

Returns notebook execution usage by day for the time range specified for this application

Method And Url

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

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, application.*, or application.notebookMinuteCounts.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for notebook execution query (ms since epoch)start=0
endNEnd of range for notebook execution query (ms since epoch)end=1465790400000

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/notebookMinuteCounts

Successful Responses

CodeTypeDescription
200Notebook Minute CountsNotebook usage information

Error Responses

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

Patch

Updates information about an application

Method And Url

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

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.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
summaryExcludeNComma-separated list of summary fields to exclude from application summarysummaryExclude=payloadCount
summaryIncludeNComma-separated list of summary fields to include in application summarysummaryInclude=payloadCount

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 Application Patch schema. For example, the following would be a valid body for this request:

{
"name": "My Updated Application",
"description": "Description of my updated application"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"name":"My Updated Application","description":"Description of my updated application"}' \
https://api.losant.com/applications/APPLICATION_ID

Successful Responses

CodeTypeDescription
200ApplicationUpdated application information

Error Responses

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

Payload Counts

Returns payload counts for the time range specified for this application

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/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, application.*, or application.payloadCounts.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for payload count query (ms since epoch)-2592000000start=0
endNEnd of range for payload count query (ms since epoch)0end=1465790400000
asBytesNIf the resulting stats should be returned as bytesfalseasBytes=true

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/payloadCounts

Successful Responses

CodeTypeDescription
200Payload StatsPayload counts, by type and source

Error Responses

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

Payload Counts Breakdown

Returns payload counts per resolution in the time range specified for this application

Method And Url

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

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, application.*, or application.payloadCountsBreakdown.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for payload count query (ms since epoch)start=0
endNEnd of range for payload count query (ms since epoch)end=1465790400000
resolutionNResolution in milliseconds. Accepted values are: 86400000, 360000086400000resolution=86400000
asBytesNIf the resulting stats should be returned as bytesfalseasBytes=true
includeNonBillableNIf non-billable payloads should be included in the resultfalseincludeNonBillable=true

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/payloadCountsBreakdown

Successful Responses

CodeTypeDescription
200Payload Counts BreakdownSum of payload counts by date

Error Responses

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

Readme

Get the current application readme information

Method And Url

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

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.cli, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.cli, all.User.read, application.*, or application.get.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

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/readme

Successful Responses

CodeTypeDescription
200Application ReadmeThe application readme information

Error Responses

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

Readme Patch

Update the current application readme information

Method And Url

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

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.cli, all.Organization, all.User, all.User.cli, application.*, or application.patch.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated 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 Application Readme Patch schema. For example, the following would be a valid body for this request:

{
"content": "The new readme content"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"content":"The new readme content"}' \
https://api.losant.com/applications/APPLICATION_ID/readme

Successful Responses

CodeTypeDescription
200Application ReadmeUpdated readme information

Error Responses

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

Search across an application's resources by target identifier

Method And Url

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

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, application.*, or application.search.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID of the associated application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
filterYThe partial resource name being searched forfilter=my dev

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/search?filter=my%20dev

Successful Responses

CodeTypeDescription
200Application Search ResultAn array of resource ids, names, descriptions, and types matching the search query

Error Responses

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

Schemas

Application

Schema for a single Application

Application Schema

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

                                        Application Example

                                        • {} 10 keys
                                          • "575ec8687ae143cd83dc4a97"
                                          • "575ec8687ae143cd83dc4a97"
                                          • "2016-06-13T04:00:00.000Z"
                                          • "2016-06-13T04:00:00.000Z"
                                          • "575ed70c7ae143cd83dc4aa9"
                                          • "user"
                                          • "My Application"
                                          • "The is the best application description"
                                          • {} 6 keys
                                            • {} 3 keys

                                            Application Apply Template Patch Schema

                                            Schema for the body of an application template import request

                                            Application Apply Template Patch Schema Schema

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

                                                    Application Apply Template Patch Schema Example

                                                    • {} 2 keys
                                                      • "575ec8687ae143cd83dc4a97"
                                                      • "email@example.com"

                                                    Success Dry Run

                                                    Schema for reporting a successful dry run of clone application

                                                    Success Dry Run Schema

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

                                                        Success Dry Run Example

                                                        • {} 2 keys
                                                          • true
                                                          • false

                                                        Application Clone Post Schema

                                                        Schema for the body of an application clone request

                                                        Application Clone Post Schema Schema

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

                                                                          Application Clone Post Schema Example

                                                                          • {} 4 keys
                                                                            • true
                                                                            • true
                                                                            • "organization"
                                                                            • "575ec8687ae143cd83dc4a98"

                                                                          Application Creation By Template Result

                                                                          Schema for creating an application by template result

                                                                          Application Creation By Template Result Schema

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

                                                                              Application Creation By Template Result Example

                                                                              • {} 1 key
                                                                                • {} 10 keys

                                                                                Application Export Post Schema

                                                                                Schema for the body of an application export request

                                                                                Application Export Post Schema Schema

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

                                                                                                  Application Export Post Schema Example

                                                                                                  • {} 3 keys
                                                                                                    • true
                                                                                                    • true
                                                                                                    • "test@example.com"

                                                                                                  Application Export Result

                                                                                                  Schema for an application export result

                                                                                                  Application Export Result Schema

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

                                                                                                    Application Export Result Example

                                                                                                    • {} 1 key
                                                                                                      • "https://example.com/applicationExport.zip"

                                                                                                    Application Global Patch

                                                                                                    Schema for the body of an Application Global modification request

                                                                                                    Application Global Patch Schema

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

                                                                                                      Application Global Patch Example

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

                                                                                                          Application Import Executions

                                                                                                          Schema for a list Application import executions

                                                                                                          Application Import Executions Schema

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

                                                                                                            Application Import Executions Example

                                                                                                            • [] 1 item
                                                                                                              • {} 14 keys

                                                                                                              Application Patch

                                                                                                              Schema for the body of an Application modification request

                                                                                                              Application Patch Schema

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

                                                                                                                                Application Patch Example

                                                                                                                                • {} 2 keys
                                                                                                                                  • "My Updated Application"
                                                                                                                                  • "Description of my updated application"

                                                                                                                                Application Readme

                                                                                                                                Schema for an Application Readme

                                                                                                                                Application Readme Schema

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

                                                                                                                                          Application Readme Example

                                                                                                                                          • {} 6 keys
                                                                                                                                            • "575ec8687ae143cd83dc4a97"
                                                                                                                                            • "2016-06-13T04:00:00.000Z"
                                                                                                                                            • "2016-06-13T04:00:00.000Z"
                                                                                                                                            • "575ed70c7ae143cd83dc4aa9"
                                                                                                                                            • "user"
                                                                                                                                            • "The readme content"

                                                                                                                                          Application Readme Patch

                                                                                                                                          Schema for the body of an Application Readme modification request

                                                                                                                                          Application Readme Patch Schema

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

                                                                                                                                            Application Readme Patch Example

                                                                                                                                            • {} 1 key
                                                                                                                                              • "The new readme content"

                                                                                                                                            Application Search Result

                                                                                                                                            Results of a search of an application's resources

                                                                                                                                            Application Search Result Schema

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

                                                                                                                                              Application Search Result Example

                                                                                                                                              • [] 1 item
                                                                                                                                                • {} 4 keys

                                                                                                                                                Device Counts

                                                                                                                                                Schema for the result of a device counts request

                                                                                                                                                Device Counts Schema

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

                                                                                                                                                      Device Counts Example

                                                                                                                                                      • {} 3 keys
                                                                                                                                                        • "1999-05-20T05:00:00.000Z"
                                                                                                                                                        • "1999-06-20T04:59:59.999Z"
                                                                                                                                                        • [] 1 item

                                                                                                                                                        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"

                                                                                                                                                            Application Import Options

                                                                                                                                                            Schema for additional application import options

                                                                                                                                                            Application Import Options Schema

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

                                                                                                                                                                              Application Import Options Example

                                                                                                                                                                              • {} 2 keys
                                                                                                                                                                                • "https://storage.example.com/myZipFile.zip"
                                                                                                                                                                                • [] 2 items

                                                                                                                                                                                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

                                                                                                                                                                                      MQTT Publish Body

                                                                                                                                                                                      Schema for the body an MQTT Publish Message request

                                                                                                                                                                                      MQTT Publish Body Schema

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

                                                                                                                                                                                            MQTT Publish Body Example

                                                                                                                                                                                            • {} 2 keys
                                                                                                                                                                                              • "an/mqtt/topic"
                                                                                                                                                                                              • "The MQTT message!"

                                                                                                                                                                                            Notebook Minute Counts

                                                                                                                                                                                            Schema for the result of a notebook minute counts request

                                                                                                                                                                                            Notebook Minute Counts Schema

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

                                                                                                                                                                                                  Notebook Minute Counts Example

                                                                                                                                                                                                  • {} 3 keys
                                                                                                                                                                                                    • "1999-05-20T05:00:00.000Z"
                                                                                                                                                                                                    • "1999-06-20T04:59:59.999Z"
                                                                                                                                                                                                    • [] 1 item

                                                                                                                                                                                                    Payload Counts Breakdown

                                                                                                                                                                                                    Schema for the result of a payload counts breakdown request

                                                                                                                                                                                                    Payload Counts Breakdown Schema

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

                                                                                                                                                                                                          Payload Counts Breakdown Example

                                                                                                                                                                                                          • {} 3 keys
                                                                                                                                                                                                            • "1999-05-20T05:00:00.000Z"
                                                                                                                                                                                                            • "1999-06-20T04:59:59.999Z"
                                                                                                                                                                                                            • [] 1 item

                                                                                                                                                                                                            Payload Stats

                                                                                                                                                                                                            Schema for the result of a payload stats request

                                                                                                                                                                                                            Payload Stats Schema

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

                                                                                                                                                                                                                                                  Payload Stats Example

                                                                                                                                                                                                                                                  • {} 6 keys
                                                                                                                                                                                                                                                    • {} 1 key
                                                                                                                                                                                                                                                      • {} 2 keys
                                                                                                                                                                                                                                                        • {} 1 key
                                                                                                                                                                                                                                                          • {} 1 key
                                                                                                                                                                                                                                                            • {} 1 key
                                                                                                                                                                                                                                                              • {} 1 key

                                                                                                                                                                                                                                                              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

                                                                                                                                                                                                                                                                Validation Error

                                                                                                                                                                                                                                                                Schema for validation errors returned by the API

                                                                                                                                                                                                                                                                Validation Error Schema

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

                                                                                                                                                                                                                                                                      Validation Error Example

                                                                                                                                                                                                                                                                      • {} 3 keys
                                                                                                                                                                                                                                                                        • "Validation"
                                                                                                                                                                                                                                                                        • "Too many validation errors occurred."
                                                                                                                                                                                                                                                                        • [] 1 item

                                                                                                                                                                                                                                                                        Was this page helpful?


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