Bulk Update Phones

Updates multiple phones in one request. The phones must share the same vendor, model, template, and ownership.

Request URL

PUT {base_url}/uc-cautop/api/v1/phones/batch

Request parameters

Headers
Parameter Required Type Description
Authorization Yes String The access token used for authentication.

Format: Bearer {access_token}.

x-tenant-code Yes String The tenant name.
Note: You can obtain tenant name using the Query Tenants interface.
Body parameters
Parameter Required Type Description
ids Yes Array<String> The list of IDs of the phones to update, supporting 1 to 100 phones. You can obtain the IDs using the Search Phones interface.
templateId No String The ID of the configuration template to switch all the phones to. You can obtain the ID using the Get Available Phone Templates interface.
phones No Array<Phone_Binding> The list of extension bindings. This parameter applies to standard phones only, and is not allowed for shared phones.
resellerId No String The ID of the reseller assigned to all the phones. If omitted, no change is made. 0 clears the reseller assignment. A positive value assigns the phones to the specified reseller.
tenantCode No String The code of the tenant assigned to all the phones. If omitted, no change is made. An empty value clears the tenant assignment. A non-empty value assigns the phones to the specified tenant.
Phone_Binding
Parameter Required Type Description
phoneId Yes String The ID of the phone, which must be one of the IDs in ids. You can obtain the ID using the Search Phones interface.
userId No String The ID of the user whose extension is bound to the phone. The extension number is resolved by the system. If omitted, the extension binding of the phone is not changed. You can obtain the ID using the Get Available Extensions for Phones interface.

Response parameters

Parameter Type Description
requestId String The unique ID of the request, which can be used to quickly locate the request.
code String The HTTP status code of the request.
  • 200: Request succeeded.
  • Non-200 value: Request failed.
message String The status message of the request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

result Object<Batch_Result> The batch operation result.
Batch_Result
Parameter Type Description
totalCount Integer The total number of phones to operate on.
successCount Integer The number of phones operated on successfully.
failedCount Integer The number of phones that fail to be operated on.
successIds Array<String> The IDs of the phones operated on successfully.
failedItems Array<Failed_Item> The list of phones that fail to be operated on, with failure reasons.
Failed_Item
Parameter Type Description
id String The ID of the failed phone.
code String The error code of the failure.
message String The description of the failure reason.
mac String The MAC address of the failed phone.

Example

Request example

PUT /uc-cautop/api/v1/phones/batch HTTP/1.1
Host: api.cn.novoone.com
Authorization: B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ZyaIv-5abg
Content-Type: application/json
x-tenant-code: jint
{
  "ids": [
    "363526077497233408",
    "363526077505622016"
  ],
  "templateId": "315428389935468544"
}

Response example

HTTP/1.1 200 OK
{
  "requestId": "aff8185c8aad11d7c165d4fe376de7c9",
  "code": "200",
  "message": "SUCCESS",
  "detailMessage": "",
  "result": {
    "totalCount": 2,
    "successCount": 2,
    "failedCount": 0,
    "successIds": [
      "363526077497233408",
      "363526077505622016"
    ],
    "failedItems": []
  }
}