Edge Deployments Actions

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

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

Get

Returns the edge deployments for an application

Method And Url

GET https://api.losant.com/applications/APPLICATION_ID/edge/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, edgeDeployments.*, or edgeDeployments.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, deviceId, flowId, desiredVersion, currentVersion, creationDate, lastUpdated lastUpdated sortField=creationDate
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
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
filterEmpty N Filter out deployments where both the current and desired version are null. filterEmpty=true
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/edge/deployments

Successful Responses

Code Type Description
200 Edge Deployments Collection of edge deployments

Error Responses

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

Release

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

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/edge/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, edgeDeployments.*, or edgeDeployments.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 Edge 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/edge/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 edge deployments from a device, remove all edge deployments of a workflow, or remove a specific workflow from a specific device

Method And Url

POST https://api.losant.com/applications/APPLICATION_ID/edge/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, edgeDeployments.*, or edgeDeployments.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 Edge 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/edge/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 edge 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/edge/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, edgeDeployments.*, or edgeDeployments.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 Edge 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/edge/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.