Edit a Certificate

Edit a PBX server certificate.

Request URL

POST {base_url}/{api_path}/certificate/update?access_token={access_token}

Request parameters

Parameter Required Type Description
id Yes Integer Certificate ID.
Note: You can query the certificate ID using Query Certificate List.
name No String Certificate file name.
Note: To replace the current certificate, you need to Upload a Certificate first, then obtain the file name from the file field in the response.
issue_to No String The domain name to be associated with the certificate.
Note: This parameter only takes effect on an applied certificate (ca_type=apply).
auto_renewal No Integer Whether to enable auto-renewal for the certificate.
Valid value:
  • 0: Disable.
  • 1: Enable.
Note: This parameter only takes effect for an imported certificate (ca_type=upload).
dns_provider No String The DNS provider used for certificate application and auto-renewal.
Note:
  • This parameter is required in the following scenarios:
    • auto_renewal is set to 1.
    • type is set to server and ca_type is set to apply.
  • For valid values, refer to the in the Flag Name column in Supported DNS Providers.
auth_info_list No Array<Auth_Info> The DNS authentication information required for certificate application and auto-renewal.
Note: This parameter is required in the following scenarios:
  • auto_renewal is set to 1.
  • type is set to server and ca_type is set to apply.
Auth_Info
Note:
  • You MUST provide the complete set of parameters required by the selected DNS provider; otherwise, the request will fail.
  • For the authentication parameters and their value types of each DNS provider, see Supported DNS Providers.
Parameter Required Type Description
k Yes String The key for the authentication parameter as defined by the DNS provider.
iv No Integer The integer-format value of the authentication parameter.
sv No String The string-format value of the authentication parameter.
bv No Boolean The boolean-format value of the authentication parameter.

Response parameters

Table 1.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.

Examples

Request example

Disable the auto-renewal for an imported certificate (id: 5).

POST /openapi/v1.0/certificate/update?access_token=wOODrqhysk0aELacF87qd4lBvmbBY4IZ HTTP/1.1
Host: 192.168.5.150:8088
Content-Type: application/json
{
    "id":5, 
    "auto_renewal": 0
}

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS"
}