Update the DID Bindings of a Cloud PBX
Assign DID numbers to a Cloud PBX to automatically associate the corresponding shared trunks, or remove existing DID assignments for a Cloud PBX.
Note: The firmware of the Cloud PBX should be 84.19.0.22 or
later.
Request URL
PUT {base_url}/dm/open_api/v1/cloud_pbx/instances/{cloudPbxId}/did
Request parameters
Path
parameter
| Parameter | Required | Type | Description |
|---|---|---|---|
| cloudPbxId | Yes | Long | The ID of the Cloud PBX. Note: You can
query the Cloud PBX ID using Query All the Cloud PBXs. |
Headers
Body parameters| Parameter | Required | Type | Description |
|---|---|---|---|
| Authorization | Yes | String | Pass the access token in the header. Format: Bearer {access_token}. |
| Parameter | Required | Type | Description |
|---|---|---|---|
| trunkDidRelations | Yes | Array <Trunk_DID_Relation> | The relation list of DID numbers to be assigned to the Cloud PBX and their associated shared trunks. |
- Trunk_DID_Relation
-
Note: If you want to remove all the existing bindings between the PBX and DID numberss, omit the following parameters in the
trunkDidRelations. For more information, see Request Example 2.Parameter Required Type Description trunkId Yes Integer The ID of the shared trunk. Note: You can query the trunk ID using Query all the Shared Trunks.didIds Yes Array <Integer> The ID list of the DID numbers. Note: You can query the DID number ID using Query All the DID Numbers.
Response parameter
| Parameter | Type | Description |
|---|---|---|
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| status | String | Request result:
|
| time | Long | The response time. Note: The YCM API response returns a
timestamp, you can convert the timestamp to detailed
date and time as needed. For more information, see Convert Timestamp to Local Date and Time.
|
Example
Request example 1
Assign DID numbers (ID: 50036 & 50044) of a register trunk (ID: 6681) to a Cloud PBX (ID: 4808).
PUT /dm/open_api/v1/cloud_pbx/instances/4808/did HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer ******
Content-Type: application/json
{
"trunkDidRelations": [
{
"didIds": [
50036,50044
],
"trunkId": 6681
}
]
}
Request example 2
Clear all binding relations of DIDs and a Cloud PBX (ID: 4808).
PUT /dm/open_api/v1/cloud_pbx/instances/4808/did HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer ******
Content-Type: application/json
{
"trunkDidRelations": [ ]
}
Response example
HTTP/1.1 200 OK
{
"requestId": "d42cdd6453bc1378ac74877a480f22c5",
"status": "Success",
"time": 1747100716
}