Skip to main content

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

NameRequiredDescriptionDefaultExample
sortFieldNField to sort the results by. Accepted values are: name, id, creationDate, ownerId, lastUpdatednamesortField=name
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page100perPage=10
filterFieldNField to filter the results by. Blank or not provided means no filtering. Accepted values are: namefilterField=name
filterNFilter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.filter=my * app
orgIdNIf 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
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

Successful Responses

CodeTypeDescription
200ApplicationsCollection of applications

Error Responses

CodeTypeDescription
400ErrorError 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

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 the application to import and all of its resources``
ownerIdNThe owner id of the new application, defaults to the id of the user making the requestownerId=575ed6e87ae143cd83dc4aa8
ownerTypeNThe type of the owner id. Accepted values are: user, organizationuserownerType=user
includeDevicesNIf set, import devices from the import bundleincludeDevices=true
includeDataTableRowsNIf set, import data table rows from import bundleincludeDataTableRows=true
includeFilesNIf set, import files from import bundleincludeFiles=true
emailNEmail 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 requestemail=email@example.com
optionsNAdditional import options. See Applications 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/import

Successful Responses

CodeTypeDescription
201Application Creation By Template ResultSuccessfully created application
202Job Enqueued API ResultIf application was enqueued to be imported

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if application is not found
422Validation ErrorError 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

NameRequiredDescriptionDefaultExample
startNStart of range for resource count queries (ms since epoch)start=0
endNEnd of range for resource count queries (ms since epoch)end=1465790400000
asBytesNIf the resulting payload counts should be returned as bytesfalseasBytes=true
includeNonBillableNIf non-billable payloads should be included in the resultfalseincludeNonBillable=true
sortFieldNField to sort the results by. Accepted values are: name, id, creationDate, ownerId, lastUpdatednamesortField=name
sortDirectionNDirection to sort the results by. Accepted values are: asc, descascsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page100perPage=10
filterFieldNField to filter the results by. Blank or not provided means no filtering. Accepted values are: namefilterField=name
filterNFilter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.filter=my * app
orgIdNIf 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
excludeNComma-separated list of resources to exclude from summaryexclude=payloadCounts, deviceCounts, notebookMinuteCounts
includeNComma-separated list of summary fields to include in application summaryinclude=deviceCounts

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

Successful Responses

CodeTypeDescription
200Application Period SummariesCollection of application period summaries

Error Responses

CodeTypeDescription
400ErrorError 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

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

CodeTypeDescription
201ApplicationSuccessfully created application

Error Responses

CodeTypeDescription
400ErrorError if malformed request

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 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 Post

                                                  Schema for the body of an Application creation request

                                                  Application Post Schema

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

                                                                          Application Post Example

                                                                          • {} 2 keys
                                                                            • "My New Application"
                                                                            • "Description of my new application"

                                                                          Applications

                                                                          Schema for a collection of Applications

                                                                          Applications Schema

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

                                                                                            Applications Example

                                                                                            • {} 7 keys
                                                                                              • [] 1 item
                                                                                                • 1
                                                                                                • 8
                                                                                                • 1
                                                                                                • 0
                                                                                                • "name"
                                                                                                • "asc"

                                                                                              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"

                                                                                                  Applications Import Options

                                                                                                  Schema for additional application import options (new application)

                                                                                                  Applications Import Options Schema

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

                                                                                                          Applications 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

                                                                                                                  Application Period Summaries

                                                                                                                  Schema for a collection of Application Period Summaries

                                                                                                                  Application Period Summaries Schema

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

                                                                                                                                    Application Period Summaries Example

                                                                                                                                    • {} 7 keys
                                                                                                                                      • [] 1 item
                                                                                                                                        • 1
                                                                                                                                        • 8
                                                                                                                                        • 1
                                                                                                                                        • 0
                                                                                                                                        • "name"
                                                                                                                                        • "asc"

                                                                                                                                      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.