Applications Actions

https://api.losant.com/applications

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

Get

Returns the applications the current user has permission to see

Method And Url

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

Authentication

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

Request Query Parameters

Name Required Description Default Example
sortField N Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, lastUpdated name sortField=name
sortDirection N Direction to sort the results by. Accepted values are: asc, desc asc sortDirection=asc
page N Which page of results to return 0 page=0
perPage N How many items to return per page 100 perPage=10
filterField N Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name filterField=name
filter N Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. filter=my * app
orgId N If not provided, return all applications. If provided but blank, only return applications belonging to the current user. If provided and an id, only return applications belonging to the given organization id. orgId=575ecdf07ae143cd83dc4a9a
summaryExclude N Comma-separated list of summary fields to exclude from application summary summaryExclude=payloadCount
summaryInclude N Comma-separated list of summary fields to include in application summary summaryInclude=payloadCount

Request Headers

Name Required Description Default
Authorization Y The 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

Successful Responses

Code Type Description
200 Applications Collection of applications

Error Responses

Code Type Description
400 Error Error if malformed request

Import

Create a new application from an import bundle

Method And Url

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

Request Headers

Name Required Description Default
Authorization Y The 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:

Name Required Description Default Example
importBundle N The zip file containing the application to import and all of its resources
ownerId N The owner id of the new application, defaults to the id of the user making the request ownerId=575ed6e87ae143cd83dc4aa8
ownerType N The type of the owner id. Accepted values are: user, organization user ownerType=user
includeDevices N If set, import devices from the import bundle includeDevices=true
includeDataTableRows N If set, import data table rows from import bundle includeDataTableRows=true
includeFiles N If set, import files from import bundle includeFiles=true
email N Email address to notify the user when the job to import the application has completed or errored, defaults to the email address of the user making the request email=email@example.com
options N Additional import options. See Applications Import Options for more details. options={”importUrl”:”https://storage.mySite.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/import

Successful Responses

Code Type Description
201 Application Creation By Template Result Successfully created application
202 Job Enqueued API Result If application was enqueued to be imported

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if application is not found
422 Validation Error Error if too many validation errors occurred on other resources

Period Summaries

Returns application usage summaries over a selected date range

Method And Url

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

Authentication

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

Request Query Parameters

Name Required Description Default Example
start N Start of range for resource count queries (ms since epoch) start=0
end N End of range for resource count queries (ms since epoch) end=1465790400000
asBytes N If the resulting payload counts should be returned as bytes false asBytes=true
includeNonBillable N If non-billable payloads should be included in the result false includeNonBillable=true
sortField N Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, lastUpdated name sortField=name
sortDirection N Direction to sort the results by. Accepted values are: asc, desc asc sortDirection=asc
page N Which page of results to return 0 page=0
perPage N How many items to return per page 100 perPage=10
filterField N Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name filterField=name
filter N Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. filter=my * app
orgId N If not provided, return all applications. If provided but blank, only return applications belonging to the current user. If provided and an id, only return applications belonging to the given organization id. orgId=575ecdf07ae143cd83dc4a9a
exclude N Comma-separated list of resources to exclude from summary exclude=payloadCounts, deviceCounts, notebookMinuteCounts
include N Comma-separated list of summary fields to include in application summary include=deviceCounts

Request Headers

Name Required Description Default
Authorization Y The 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/periodSummaries

Successful Responses

Code Type Description
200 Application Period Summaries Collection of application period summaries

Error Responses

Code Type Description
400 Error Error if malformed request

Post

Create a new application

Method And Url

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

Authentication

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

Request Query Parameters

Name Required Description Default Example
summaryExclude N Comma-separated list of summary fields to exclude from application summary summaryExclude=payloadCount
summaryInclude N Comma-separated list of summary fields to include in application summary summaryInclude=payloadCount

Request Headers

Name Required Description Default
Authorization Y The token for authenticating the request, prepended with Bearer

Request Body

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

{
  "name": "My New Application",
  "description": "Description of my new application"
}

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 Application","description":"Description of my new application"}' \
    https://api.losant.com/applications

Successful Responses

Code Type Description
201 Application Successfully created application

Error Responses

Code Type Description
400 Error Error if malformed request

Was this page helpful?


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