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 Component Description Example
APPLICATION_ID ID associated with the application 575ec8687ae143cd83dc4a97

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

Code Type Description
202 Job Enqueued API Result If generation of export was successfully started

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
APPLICATION_ID ID associated with the application 575ec8687ae143cd83dc4a97

Request Query Parameters

Name Required Description Default Example
sortField N Field to sort the results by. Accepted values are: id, creationDate, lastUpdated lastUpdated sortField=creationDate
sortDirection N Direction to sort the results by. Accepted values are: asc, desc desc sortDirection=asc
page N Which page of results to return 0 page=0
perPage N How many items to return per page 1000 perPage=10
deviceId N Filter deployments to the given Device ID deviceId=575ecf887ae143cd83dc4aa2
version N Filter deployments to the given Workflow Version (matches against both current and desired) version=myFlowVersion
flowId N Filter deployments to the given Workflow ID flowId=575ed18f7ae143cd83dc4aa6

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

Successful Responses

Code Type Description
200 Embedded Deployments Collection of embedded deployments

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
APPLICATION_ID ID associated with the application 575ec8687ae143cd83dc4a97

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

Code Type Description
201 Success If deployment release has been initiated successfully

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
APPLICATION_ID ID associated with the application 575ec8687ae143cd83dc4a97

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

Code Type Description
201 Success If deployment removal has been initiated successfully

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error 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 Component Description Example
APPLICATION_ID ID associated with the application 575ec8687ae143cd83dc4a97

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

Code Type Description
201 Success If deployment replacement has been initiated successfully

Error Responses

Code Type Description
400 Error Error if malformed request
404 Error Error if application was not found

Was this page helpful?


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