Use this endpoint to add a device to manage. The request body includes the device profile that the new device configuration must follow. It also includes any fields the device profile requires.
curl --request POST 'https://one.digicert.com/iot/api/v2/device' \
--header 'x-api-key: {{api_key}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"division_id": "fd5faa1e-623a-47a9-831b-b9397c33395f",
"device_identifier": "New Device",
"device_profile_id": "a81a431a-be7b-4f2e-8afd-b2778491511f",
"fields": [
{
"id": "417c328e-604c-4e94-9112-ee58f12277fb",
"value": "mandatory value"
},
{
"id": "90eb4de2-ae8a-48a0-a904-d30c5ab6e1de",
"value": "optional value"
}
]
}'
{
"id": "64c02969-3890-4da8-a5ef-b574fd72887e",
"account_id": "1d1ec1ec-6502-11e9-a923-1681be663d3e",
"division": {
"id": "fd5faa1e-623a-47a9-831b-b9397c33395f",
"name": "Mock Division 1"
},
"device_identifier": "New Device",
"device_profile": {
"id": "a81a431a-be7b-4f2e-8afd-b2778491511f",
"name": "Device Profile"
},
"created": "2020-04-22T07:13:20Z",
"updated": "2020-04-22T07:13:20Z",
"status": "ACTIVE",
"fields": [
{
"id": "417c328e-604c-4e94-9112-ee58f12277fb",
"name": "Mandatory Field",
"value": "mandatory value",
"mandatory": true
},
{
"id": "90eb4de2-ae8a-48a0-a904-d30c5ab6e1de",
"name": "Optional Field",
"value": "optional value",
"mandatory": false
}
],
"device_api_allow_read": true,
"device_api_allow_write": true,
"device_api_allow_renew_certificate": true
}
{
"errors": [
{
"code": "invalid_input",
"message": "Device with division fd5faa1e-623a-47a9-831b-b9397c33395f and identifier New Device already exists"
}
]
}
Name | Req/Opt | Type | Description |
---|---|---|---|
division_id | required | string | Division ID. |
device_identifier | required | string |
Unique device name. Character limit: 255 |
device_profile_id | required | string | Existing device profile ID. Device profile is the template for the new device. |
fields | defined in device profile | array | Array of fields that describe device attributes and settings. |
.. id | - | string | Existing field ID as defined in device profile. |
.. value | - | string |
New field value. Character limit: 1024 |
device_api_allow_read | optional | boolean |
Whether the device can read its own device information. This setting applies to calls on the Get device details by ID (client authentication) endpoint that use TLS authentication. Default: true
|
device_api_allow_write | optional | boolean |
Whether the device can update its own device information. This setting applies to calls on the Update device by ID (client authentication) endpoint that use TLS authentication. Default: true
|
device_api_allow_renew_certificate | optional | boolean |
Whether the device can renew its own certificates. This setting applies to calls on the Renew device certificate by device ID (client authentication) endpoint that use TLS authentication. Default: true
|
Name | Type | Description |
---|---|---|
id | string | Unique device ID created for the new device. |
account_id | string | Account ID. |
division | object | Division container. |
.. id | string | Division ID. |
.. name | string | Division name. |
device_identifier | string | Unique device name submitted in the request. |
device_profile | object | Device profile container. |
.. id | string | Device profile ID. |
.. name | string | Device profile name. |
created | string | Date and time (UTC) new device was created. |
updated | string | Date and time (UTC) device was last updated. |
status | string |
Device status. Possible values: ACTIVE , DISABLED , DELETED For a newly created device, status is expected to be ACTIVE .
|
fields | array | Array of fields that describe device attributes and settings. |
.. id | string | Unique field ID created for the new device. |
.. name | string | Field name. |
.. value | string | Field value. |
.. mandatory | boolean | Whether or not the field is required, based on the device profile. |
device_api_allow_read | boolean |
Whether the device can read its own device information. This setting applies to calls on the Get device details by ID (client authentication) endpoint that use TLS authentication. |
device_api_allow_write | boolean |
Whether the device can update its own device information. This setting applies to calls on the Update device by ID (client authentication) endpoint that use TLS authentication. |
device_api_allow_renew_certificate | boolean |
Whether the device can renew its own certificates. This setting applies to calls on the Renew device certificate by device ID (client authentication) endpoint that use TLS authentication. |