Assign DIDs to a Reseller
Assigns multiple DIDs to a reseller, or recalls them to the administrator account, in one atomic operation. All the specified DIDs take effect or none of them does.
Request URL
PUT {base_url}/uc-cconfig/api/v1/dids/assignment
Request parameters
- Headers
-
Parameter Required Type Description Authorization Yes String The access token used for authentication. Format: Bearer
{access_token}.x-tenant-code No String The tenant name. Note: You can obtain tenant name using the Query Tenants interface.
- Body parameters
-
Parameter Required Type Description didIds Yes Array<String> The list of DID IDs to assign, supporting 1 to 500 DIDs. Each ID must be greater than 0. You can obtain the IDs using the Query DID List interface. targetResellerId Yes String The ID of the target reseller, which must be a numeric string. Set this parameter to 0to recall the DIDs to the administrator account. You can obtain the ID using the Search Resellers 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.
|
| 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<Assignment_Result> | The assignment result. |
- Assignment_Result
-
Parameter Type Description assignedCount Integer The number of DIDs that are assigned successfully.
Example
Request example
PUT /uc-cconfig/api/v1/dids/assignment HTTP/1.1
Host: api.cn.novoone.com
Authorization: Bearer eyJraWQiOiJjbi0wLWtleS0xIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJkaXN0cmlidXRvcmV4YW1wbGVAb3V0bG9vay5jb20iLCJhcHBfa2V5Ijoic2xOdnQzaHc1NXB2Vm5HRlNhR2ZOVTNmMWxYQ3lpa08iLCJncmFudF90eXBlIjoib3BlbmFwaSIsImNsaWVudF9leHQiOnsiZGVzY3JpcHRpb24iOiLnrKzkuInmlrnlkIjkvZzkvJnkvLTlupTnlKgiLCJwYXJ0bmVyIjoi56S65L6L5ZCI5L2c5LyZ5Ly0In0sImNsaWVudF90eXBlIjoib3BlbmFwaSIsImV4cCI6MTc5MzYzODk1MywiaWF0IjoxNzkzNjE3MzUzLCJqdGkiOiIzMTg2YTYxNi0yOTdjLTRkNzMtODRkZC1lNzNkODE1ZDRmYmYiLCJjbGllbnRfaWQiOiJub3ZvLW9wZW4tcGxhdGZvcm0iLCJ1c2VyX2V4dCI6eyJyb2xlSWRzIjpbM10sInN0eXBlIjoiQURNSU4iLCJ0ZW5hbnRDb2RlIjpudWxsLCJ0eXBlIjoiUF9BQ0NPVU5UIiwidXNlcklkIjozMDc2OTEzNjQ0OTE1OTk4NzIwLCJlbWFpbCI6ImRpc3RyaWJ1dG9yZXhhbXBsZUBvdXRsb29rLmNvbSIsInVzZXJuYW1lIjoiZGlzdHJpYnV0b3JleGFtcGxlQG91dGxvb2suY29tIiwidWNJZCI6MzA3NjkxMzY0NDg5MDgzMjg5Nn19.FR6Pir4F-5uDAVqebnXRnVymCoQlN5je95U9NywVCtrMLYnEjMNH1cw20Gz81DothBN4jXNzWT6A1V-DcghGQyjNjAAqfwTLYxAeksE_h8myiynhB67sB0VS6EPv8MTkEdVk4dmujjkQXU2yFVzlpQNvLwQhFDqpxlwpsom-Uk5jNh-JpWzpWJs9JP9Bn3oIZAwv847fXkvG_rSkBc2AAHf3y-zpRZ8nEZF4WDSCoEMfbsTdT5qahecCcThvJesTGFWyA1eW4xEUDplwZpnO-s7DIsbUrSO_123ylqOz0YZm2EirVJwr7j4KPzXFtTZdcvZ6t5mI9ofDbXG0woeTOw
Content-Type: application/json
{
"didIds": [
"375602272973185024",
"375602273472307200"
],
"targetResellerId": "3471902689642823680"
}
Response example
HTTP/1.1 200 OK { "requestId": "ecf463377835cc4f6790966b2816b67f", "code": "200", "message": "SUCCESS", "detailMessage": "", "result": { "assignedCount": 2 } }
Note:
The target reseller must have usage rights on every trunk bound to the selected DIDs. Otherwise, the request fails with 422 and the error code 1503422011 (COMMCTL_CONFIG_DID_RESELLER_NOT_ASSIGNED_TO_TRUNK).