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