Details on the various actions that can be performed on the
Device Recipe resource, including the expected
parameters and the potential responses.
Bulk creates devices using this recipe from a CSV
var params = {
applicationId: myApplicationId,
deviceRecipeId: myDeviceRecipeId,
bulkInfo: myBulkInfo
};
// with callbacks
client.deviceRecipe.bulkCreate(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.deviceRecipe.bulkCreate(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Organization, all.User, deviceRecipe.*, or deviceRecipe.bulkCreate.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
deviceRecipeId |
string |
Y |
ID associated with the device recipe |
|
575ecec57ae143cd83dc4a9f |
bulkInfo |
Device Recipe Bulk Create Post |
Y |
Object containing bulk creation info |
|
Device Recipe Bulk Create Post Example |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if device recipe was not found |
Deletes a device recipe
var params = {
applicationId: myApplicationId,
deviceRecipeId: myDeviceRecipeId
};
// with callbacks
client.deviceRecipe.delete(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.deviceRecipe.delete(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Organization, all.User, deviceRecipe.*, or deviceRecipe.delete.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
deviceRecipeId |
string |
Y |
ID associated with the device recipe |
|
575ecec57ae143cd83dc4a9f |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
200 |
Success |
If device recipe was successfully deleted |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if device recipe was not found |
Retrieves information on a device recipe
var params = {
applicationId: myApplicationId,
deviceRecipeId: myDeviceRecipeId
};
// with callbacks
client.deviceRecipe.get(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.deviceRecipe.get(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. 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.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
deviceRecipeId |
string |
Y |
ID associated with the device recipe |
|
575ecec57ae143cd83dc4a9f |
tagsAsObject |
string |
N |
Return tags as an object map instead of an array |
|
true |
attributesAsObject |
string |
N |
Return attributes as an object map instead of an array |
|
true |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
200 |
Device Recipe |
Device recipe information |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if device recipe was not found |
Updates information about a device recipe
var params = {
applicationId: myApplicationId,
deviceRecipeId: myDeviceRecipeId,
deviceRecipe: myDeviceRecipe
};
// with callbacks
client.deviceRecipe.patch(params, function (err, result) {
if (err) { return console.error(err); }
console.log(result);
});
// with promises
client.deviceRecipe.patch(params)
.then(console.log)
.catch(console.error);
The client must be configured with a valid api access token to call this
action. The token must include at least one of the following scopes:
all.Application, all.Organization, all.User, deviceRecipe.*, or deviceRecipe.patch.
Name |
Type |
Required |
Description |
Default |
Example |
applicationId |
string |
Y |
ID associated with the application |
|
575ec8687ae143cd83dc4a97 |
deviceRecipeId |
string |
Y |
ID associated with the device recipe |
|
575ecec57ae143cd83dc4a9f |
deviceRecipe |
Device Recipe Patch |
Y |
Object containing new properties of the device recipe |
|
Device Recipe Patch Example |
tagsAsObject |
string |
N |
Return tags as an object map instead of an array |
|
false |
attributesAsObject |
string |
N |
Return attributes as an object map instead of an array |
|
false |
losantdomain |
string |
N |
Domain scope of request (rarely needed) |
|
example.com |
Code |
Type |
Description |
200 |
Device Recipe |
Updated device recipe information |
Code |
Type |
Description |
400 |
Error |
Error if malformed request |
404 |
Error |
Error if device recipe was not found |