Updated on 2025-10-28 GMT+08:00

Diverting Cloud Phone Traffic

Function

This API is used to modify the route of a cloud phone.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

URI

POST /v1/{project_id}/cloud-phone/phones-traffic

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

traffic_type

Yes

String

Mobile phone route type.

  • direct: default route

  • routing: routing to the encoding container

phone_ids

Yes

Array of strings

Specifies the cloud phone ID list. A maximum of 100 IDs can be invoked at a time.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique request ID.

jobs

Array of PhoneJob objects

Task list.

Table 5 PhoneJob

Parameter

Type

Description

phone_id

String

Specifies the unique ID of a cloud phone. This parameter is contained in tasks related to cloud phones.

job_id

String

Specifies the unique ID of a task.

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Example Requests

Changing the routes of all cloud phones listed in phone_ids to the same route

POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones-traffic 

{
  "traffic_type" : "routing",
  "phone_ids" : [ "631056bfb66b4f4ea02ba25f04830cb4" ]
}

Example Responses

Status code: 200

OK

{
  "request_id" : "6837531fd3f54550927b930180a706bf",
  "jobs" : [ {
    "phone_id" : "631056bfb66b4f4ea02ba25f04830cb4",
    "job_id" : "1564567b8bab40f34711234cb80d0123"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.