Update Device
Updates the information for the device specified by <deviceId>. Currently, the API supports updating the description, roles, and dynamic fields.
Users can only update information for devices that are accessible based on their roles.
URL |
Copy
|
Method |
|
For information on a previous version of this endpoint, see Update Device | Legacy.
Header parameters
Name |
Description |
---|---|
|
The Perfecto security token. For more information, see Generate security tokens. |
Request parameters
Name | Type | Description |
---|---|---|
|
string |
The new device description. |
|
list of strings |
Comma separated list of device roles. |
|
list |
To set this, you need to pass the The following
Copy
Usage syntax
Copy
Example: dynamicField.timeout=10
|
To remove all roles, use the roles parameter with an empty value. There is no way to remove all dynamic fields.
Sample request body
{
"description": "SOME_DESCRIPTION",
"roles": ["role1", "role2"],
"customFields": [
{
"name": "FIELD_NAME",
"value": "FIELD_VALUE",
"category": "DYNAMIC_FIELDS"
},
{
"name": "FIELD_NAME",
"value": "FIELD_vALUE",
"category": "ADMIN_FIELDS"
}
]
}
Success response
Code: 200
Error response
[
{
"userMessage":"ERROR_MESSAGE",
"developerMessage": "1-63dbebb1-4521fab52df9f41a578221c8"
}
]
where:
-
userMessage
is the error message to be shown. -
developerMessage
is a value that you can send to Perfecto Support to check errors if further investigation is required.
Sample error responses
A wrong securityToken is passed in the request (Unauthorized Request Code - 401)
[
{
"userMessage": "Unable to authenticate bearer token",
"developerMessage": "Unable to authenticate bearer token"
}
]
An invalid name
field is provided in customFields
(Bad Request Code - 400)
[
{
"userMessage": "Not all custom fields have a name. customField:CustomField{name='', value='value', category=ADMIN_FIELDS}",
"developerMessage": "2b9ff1d1b7c74b1ea763494d3e685c38"
}
]
An invalid category
is provided in customFields
(Bad Request Code - 400)
[
{
"userMessage": "Invalid category provided.",
"developerMessage": "410f544252e14bd8b5ce88e84f86013c"
}
]