Updated on 2024-08-09 GMT+08:00

Updating Properties of Cloud Phones

Function

Some cloud phone attributes can be updated. Some attributes cannot be updated, and some attributes take effect only after the phone is restarted. For details about attribute restrictions, see the cloud phone attribute list. If the cloud phone is in the abnormal state, the updated attributes take effect only after the cloud phone is restored to the running state. This API is an asynchronous API.

URI

POST /v1/{project_id}/cloud-phone/phones/batch-update-property

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

phones

Yes

Array of Property objects

Specifies the cloud phone list.

Table 4 Property

Parameter

Mandatory

Type

Description

phone_id

Yes

String

Specifies the cloud phone ID, which can contain a maximum of 32 bytes.

property

Yes

String

Specifies the cloud phone property list, which is a JSON string.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the unique request ID.

jobs

Array of PhoneJob objects

Task information

Table 6 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

Updating properties of cloud phones

POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones/batch-update-property

{
  "phones" : [ {
    "phone_id" : "a7f3a1c5258347d6b6f1def79e11f2bc",
    "property" : "{\"sys.prop.writephonenum\":\"13666666666\",\"sys.prop.writeimsi\":\"460021624617113\",\"sys.prop.writewifissid\":\"test_wifi\"}"
  }, {
    "phone_id" : "1678567b8bab40f93711234cb80d0764",
    "property" : "{\"sys.prop.writephonenum\":\"13666666666\",\"sys.prop.writeimsi\":\"460021624617113\",\"sys.prop.writewifissid\":\"test_wifi\"}"
  } ]
}

Example Responses

Status code: 200

OK

{
  "request_id" : "6837531fd3f54550927b930180a706bf",
  "jobs" : [ {
    "phone_id" : "1234567b8bab40ffb711234cb80d0234",
    "job_id" : "1564567b8bab40f34711234cb80d0123"
  }, {
    "phone_id" : "1678567b8bab40f93711234cb80d0764",
    "error_code" : "CPS.0005",
    "error_msg" : "Parameter: Phone not found."
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.