Instance Custom Node Actions

https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

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

Delete

Deletes a Custom Node

Method And Url

DELETE https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceCustomNode.*, or instanceCustomNode.delete.

Request Path Components

Path Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
INSTANCECUSTOMNODE_ID ID associated with the Custom Node 575ec7417ae143cd83dc4a95

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 DELETE \
    https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

Successful Responses

Code Type Description
200 Success If Custom Node was successfully deleted

Error Responses

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

Errors

Get information about errors that occurred during runs of this Custom Node

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID/errors

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNode.*, or instanceCustomNode.errors.

Request Path Components

Path Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
INSTANCECUSTOMNODE_ID ID associated with the Custom Node 575ec7417ae143cd83dc4a95

Request Query Parameters

Name Required Description Default Example
duration N Duration of time range in milliseconds 86400000 duration=86400000
end N End of time range in milliseconds since epoch 0 end=0
limit N Maximum number of errors to return 25 limit=25
sortDirection N Direction to sort the results by. Accepted values are: asc, desc desc sortDirection=desc

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/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID/errors

Successful Responses

Code Type Description
200 Workflow Errors Custom Node error information

Error Responses

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

Get

Retrieves information on a Custom Node

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNode.*, or instanceCustomNode.get.

Request Path Components

Path Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
INSTANCECUSTOMNODE_ID ID associated with the Custom Node 575ec7417ae143cd83dc4a95

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/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

Successful Responses

Code Type Description
200 Instance Custom Node Custom Node information

Error Responses

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

Patch

Updates information about a Custom Node

Method And Url

PATCH https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceCustomNode.*, or instanceCustomNode.patch.

Request Path Components

Path Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
INSTANCECUSTOMNODE_ID ID associated with the Custom Node 575ec7417ae143cd83dc4a95

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 Instance Custom Node Patch schema. For example, the following would be a valid body for this request:

{
  "name": "My Updated Instance Custom Node",
  "category": "logic"
}

Curl Example

curl -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
    -X PATCH \
    -d '{"name":"My Updated Instance Custom Node","category":"logic"}' \
    https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID

Successful Responses

Code Type Description
200 Instance Custom Node Updated Custom Node information

Error Responses

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

Stats

Get statistics about runs for this Custom Node

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID/stats

Authentication

A valid api access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceCustomNode.*, or instanceCustomNode.stats.

Request Path Components

Path Component Description Example
INSTANCE_ID ID associated with the instance 575ec7417ae143cd83dc4a96
INSTANCECUSTOMNODE_ID ID associated with the Custom Node 575ec7417ae143cd83dc4a95

Request Query Parameters

Name Required Description Default Example
duration N Duration of time range in milliseconds 86400000 duration=86400000
end N End of time range in milliseconds since epoch 0 end=0
resolution N Resolution in milliseconds 3600000 resolution=3600000

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/instances/INSTANCE_ID/nodes/INSTANCE_CUSTOM_NODE_ID/stats

Successful Responses

Code Type Description
200 Workflow Statistics Statistics for Custom Node runs

Error Responses

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

Was this page helpful?


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