Updated on 2024-07-25 GMT+08:00

Querying a Certificate

Function

This API is used to query a certificate.

URI

GET /v1/{project_id}/waf/certificate/{certificate_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

certificate_id

Yes

String

HTTPS certificate ID. It can be obtained by calling the ListCertificates API.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

ID of the enterprise project. It can be obtained by called the ListEnterpriseProject API of EPS.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Content-Type

Yes

String

Content type

Default: application/json;charset=utf8

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

id

String

Certificate ID.

name

String

Certificate Name

content

String

Certificate file, which is in PEM format.

key

String

Private key of the certificate, which is in PEM format.

expire_time

Long

Certificate expiration timestamp

exp_status

Integer

Certificate status. The options are 0, 1, and 2. 0: The certificate is valid. 1: The certificate has expired; 2: The certificate will expire within one month.

timestamp

Long

Certificate upload timestamp

bind_host

Array of BindHost objects

Domain name associated with the certificate

Table 5 BindHost

Parameter

Type

Description

id

String

Domain ID

hostname

String

Protected domain name

waf_type

String

Domain name mode: cloud (cloud mode)/premium (dedicated mode)

mode

String

This parameter is required only by the dedicated mode.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_msg

String

Error Messages

Example Requests

GET https://{Endpoint}/v1/{project_id}/waf/certificate/{certificate_id}?enterprise_project_id=0

Example Responses

Status code: 200

OK

{
  "id" : "6e2be127b79f4a418414952ad5d8c59f",
  "name" : "certificatename94319",
  "content" : "-----BEGIN CERTIFICATE-----\nMIIB+TCCAaOgAwIBAgIUJP9I8OupQ77w0bGL2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AQIgK8N+j1daq63b0bJ9k4HruhQtpgxI6U9nFBemH4zTRYM=\n-----END RSA PRIVATE KEY-----",
  "timestamp" : 1650595334578,
  "expire_time" : 1596865564000,
  "bind_host" : [ {
    "id" : "978b411657624c2db069cd5484195d1c",
    "hostname" : "www.demo.com",
    "waf_type" : "cloud"
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Request failed.

401

Insufficient token permissions.

500

Internal server error.

Error Codes

See Error Codes.