Below are the various requests that can be performed against the
Device Recipe resource, as well as the expected
parameters and the potential responses.
Bulk Create
Bulk creates devices using this recipe from a CSV
Method And Url
POST https://api.losant.com/applications/APPLICATION_ID/device-recipes/DEVICE_RECIPE_ID/bulkCreate
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, deviceRecipe.*, or deviceRecipe.bulkCreate.
Request Path Components
Path Component
Description
Example
APPLICATION_ID
ID associated with the application
575ec8687ae143cd83dc4a97
DEVICERECIPEID
ID associated with the device recipe
575ecec57ae143cd83dc4a9f
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 Device Recipe Bulk Create Post schema. For example, the following would be a
valid body for this request:
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, deviceRecipe.*, or deviceRecipe.delete.
Request Path Components
Path Component
Description
Example
APPLICATION_ID
ID associated with the application
575ec8687ae143cd83dc4a97
DEVICERECIPEID
ID associated with the device recipe
575ecec57ae143cd83dc4a9f
Request Headers
Name
Required
Description
Default
Authorization
Y
The token for authenticating the request, prepended with Bearer
GET https://api.losant.com/applications/APPLICATION_ID/device-recipes/DEVICE_RECIPE_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.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, deviceRecipe.*, or deviceRecipe.get.
Request Path Components
Path Component
Description
Example
APPLICATION_ID
ID associated with the application
575ec8687ae143cd83dc4a97
DEVICERECIPEID
ID associated with the device recipe
575ecec57ae143cd83dc4a9f
Request Query Parameters
Name
Required
Description
Default
Example
tagsAsObject
N
Return tags as an object map instead of an array
tagsAsObject=true
attributesAsObject
N
Return attributes as an object map instead of an array
attributesAsObject=true
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/device-recipes/DEVICE_RECIPE_ID
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, deviceRecipe.*, or deviceRecipe.patch.
Request Path Components
Path Component
Description
Example
APPLICATION_ID
ID associated with the application
575ec8687ae143cd83dc4a97
DEVICERECIPEID
ID associated with the device recipe
575ecec57ae143cd83dc4a9f
Request Query Parameters
Name
Required
Description
Default
Example
tagsAsObject
N
Return tags as an object map instead of an array
tagsAsObject=false
attributesAsObject
N
Return attributes as an object map instead of an array
attributesAsObject=false
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 Device Recipe Patch schema. For example, the following would be a
valid body for this request:
{"name":"My Updated Device Recipe","deviceName":"Future device name","description":"Description of my updated device recipe","deviceDescription":"Future device description","tags":[{"key":"TagKey","value":"TagValue"}],"attributes":[{"name":"voltage","dataType":"number"}],"deviceClass":"standalone"}
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 Device Recipe","deviceName":"Future device name","description":"Description of my updated device recipe","deviceDescription":"Future device description","tags":[{"key":"TagKey","value":"TagValue"}],"attributes":[{"name":"voltage","dataType":"number"}],"deviceClass":"standalone"}'\
https://api.losant.com/applications/APPLICATION_ID/device-recipes/DEVICE_RECIPE_ID