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
Parameter Required Type Description
Authorization Yes String Pass the access token in the header.

Format: Bearer {access_token}.

Body parameters
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.
customSipHeadersBindings No Array <Custom_SIP_Header> The list of custom SIP headers to be assigned to the Cloud PBX and their associated shared trunks.
Note:
  • The provided list will completely overwrite all existing custom SIP headers. Any headers not included in the request will be removed.
  • This parameter only takes effect when the firmware of Cloud PBX is 84.22.0.134 or later.
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 Available Shared Trunks.
didIds Yes Array<Integer> The ID list of the DID numbers.
Note: You can query the DID number ID using Query Available DID Numbers of Specific Trunk.
Custom_SIP_Header
Parameter Required Type Description
trunkId Yes Integer The ID of the shared trunk.
Note: This parameter only takes effect when it is set to a trunk ID contained in trunkDidRelations.
headerId Yes Integer The ID of the custom SIP header.
Note: You can query the ID of custom SIP header using Query a Specific Shared Trunk.
value Yes String The value of the custom SIP header.

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:
  • Success
  • Failed
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
}