Create Configuration Tasks
Create config tasks to apply the configurations to remote devices. This is suitable for bulk devices or a wealth of configuration parameters. For single device and simple parameter updates, please refer to Update Device Properties Incrementally.
Request URL
POST {base_url}/device/openapi/v1/tasks
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
Authorization | Yes | String | The valid access token for making API calls. The format should be Bearer {access_token}. |
Parameter | Required | Type | Description |
---|---|---|---|
type | Yes | Enum <String> | The config template type for Auto Provision. Valid
value:
|
deviceIds | Yes | Array<Long> | The unique ID of devices, which is returned when you add the
device. The device IDs can be separated with comma or semicolon. Note: If you did NOT save the deviceIDs,
you can query the device's ID using Search Specific
Devices.
|
config | Yes | JSON |
The configuration for Auto Provision, which is presented in below JSON format. You can get the configuration template by Copy the content of Config Template or Getting the Configuration API, and change the configurations as required. Beside, you can also below formats to generate the configurations.
|
Response Parameters
Parameter | Type | Description |
---|---|---|
data | Object<Task_Create_Result> | Information of the task. |
status | String | The result of the API request.
|
requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
- Task_Create_Result
-
Parameter Type Description deviceTaskRelations String The device lists and their related tasks. deviceId Long The unique ID of this device on Milesight Development Platform. taskId Long The unique ID of the Config task generated on Milesight Development Platform.
Examples
- Request example
- Create a Config task to apply configuration to a VS133-P device.
- Response example
-
HTTP/1.1 200 OK { "data": { "deviceTaskRelations": [ { "deviceId": "1904041077351141377", "taskId": "1904498522747006977" } ] }, "status": "Success", "requestId": "de178ad55e213624facc3d82bb06cfe7" }