Skip to main content

Embedded Deployments Actions

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

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

Export

Request an export of the compiled WASM files for a current deployment

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/export

Authentication

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

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

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

{
"email": "email@example.com",
"deviceId": "575ecf887ae143cd83dc4aa2"
}

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/embedded/deployments/export

Successful Responses

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

Error Responses

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

Get

Returns the embedded deployments for an application

Method And Url

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

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, embeddedDeployments.*, or embeddedDeployments.get.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Query Parameters

NameRequiredDescriptionDefaultExample
sortFieldNField to sort the results by. Accepted values are: id, creationDate, lastUpdatedlastUpdatedsortField=creationDate
sortDirectionNDirection to sort the results by. Accepted values are: asc, descdescsortDirection=asc
pageNWhich page of results to return0page=0
perPageNHow many items to return per page1000perPage=10
deviceIdNFilter deployments to the given Device IDdeviceId=575ecf887ae143cd83dc4aa2
versionNFilter deployments to the given Workflow Version (matches against both current and desired)version=myFlowVersion
flowIdNFilter deployments to the given Workflow IDflowId=575ed18f7ae143cd83dc4aa6

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/embedded/deployments

Successful Responses

CodeTypeDescription
200Embedded DeploymentsCollection of embedded deployments

Error Responses

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

Release

Deploy an embedded workflow version to one or more embedded devices. Version can be blank, if removal is desired.

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/release

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, embeddedDeployments.*, or embeddedDeployments.release.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

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

{
"flowId": "575ed18f7ae143cd83dc4aa6",
"version": "v1.2.3",
"deviceIds": [
"575ecf887ae143cd83dc4aa2"
]
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"flowId":"575ed18f7ae143cd83dc4aa6","version":"v1.2.3","deviceIds":["575ecf887ae143cd83dc4aa2"]}' \
https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/release

Successful Responses

CodeTypeDescription
201SuccessIf deployment release has been initiated successfully

Error Responses

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

Remove

Remove all embedded deployments from a device, remove all embedded deployments of a workflow, or remove a specific workflow from a specific device

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/remove

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, embeddedDeployments.*, or embeddedDeployments.remove.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

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

{
"flowId": "575ed18f7ae143cd83dc4aa6",
"deviceId": null
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"flowId":"575ed18f7ae143cd83dc4aa6","deviceId":null}' \
https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/remove

Successful Responses

CodeTypeDescription
201SuccessIf deployment removal has been initiated successfully

Error Responses

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

Replace

Replace deployments of an embedded workflow version with a new version. New version can be blank, if removal is desired.

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/replace

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, embeddedDeployments.*, or embeddedDeployments.replace.

Request Path Components

Path ComponentDescriptionExample
APPLICATION_IDID associated with the application575ec8687ae143cd83dc4a97

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

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

{
"flowId": "575ed18f7ae143cd83dc4aa6",
"oldVersion": "v1.2.3",
"newVersion": "v1.2.4"
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X POST \
-d '{"flowId":"575ed18f7ae143cd83dc4aa6","oldVersion":"v1.2.3","newVersion":"v1.2.4"}' \
https://api.losant.com/applications/APPLICATION_ID/embedded/deployments/replace

Successful Responses

CodeTypeDescription
201SuccessIf deployment replacement has been initiated successfully

Error Responses

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

Schemas

Embedded Deployment Export

Schema for the body of a compiled embedded deployment files request

Embedded Deployment Export Schema

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

                      Embedded Deployment Export Example

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

                      Embedded Deployment Release

                      Schema for deploying an embedded workflow to one or more edge devices

                      Embedded Deployment Release Schema

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

                                  Embedded Deployment Release Example

                                  • {} 3 keys
                                    • "575ed18f7ae143cd83dc4aa6"
                                    • "v1.2.3"
                                    • [] 1 item

                                    Embedded Deployment Remove

                                    Schema for removing embedded deployments. Can remove a specific workflow from a specific device, can remove all workflows from a specific device, or can remove a specific workflow from all devices.

                                    Embedded Deployment Remove Schema

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

                                          Embedded Deployment Remove Example

                                          • {} 2 keys
                                            • "575ed18f7ae143cd83dc4aa6"
                                            • null

                                          Embedded Deployment Replace

                                          Schema for replacing a deployment of a workflow version with a different workflow version

                                          Embedded Deployment Replace Schema

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

                                                  Embedded Deployment Replace Example

                                                  • {} 3 keys
                                                    • "575ed18f7ae143cd83dc4aa6"
                                                    • "v1.2.3"
                                                    • "v1.2.4"

                                                  Embedded Deployments

                                                  Schema for a collection of Embedded Deployments

                                                  Embedded Deployments Schema

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

                                                                Embedded Deployments Example

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

                                                                  Error

                                                                  Schema for errors returned by the API

                                                                  Error Schema

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

                                                                      Error Example

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

                                                                      Job Enqueued API Result

                                                                      Schema for the result of a job being queued

                                                                      Job Enqueued API Result Schema

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

                                                                            Job Enqueued API Result Example

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

                                                                            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

                                                                              Was this page helpful?


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