Updated on 2022-02-21 GMT+08:00

Adding a Certificate to a Domain Name

Function

When you create an API to be accessed through HTTPS, you must add an SSL certificate to the independent domain name that has been bound to the group the API belongs to.

This API is used to add a certificate to a specific domain name.

URI

The following table lists the HTTP/HTTPS request method and URI of the API.

Table 1 HTTP/HTTPS request method and URI

Request Method

URI

POST

/v1.0/apigw/api-groups/{group_id}/domains/{domain_id}/certificate

The following table lists the parameters in the URI.

Table 2 Parameter description

Parameter

Mandatory

Type

Description

group_id

Yes

String

API group ID

domain_id

Yes

String

Domain ID

Request

Table 3 Parameter description

Parameter

Mandatory

Type

Description

name

Yes

String

Certificate name

A certificate name consists of 4–50 characters, starting with a letter. Only letters, digits, and underscores (_) are allowed.

cert_content

Yes

String

Content of the certificate

private_key

Yes

String

Private key

Example request:

{
	"cert_content": "example",
	"name": "test_ssl",
	"private_key": "example"
}

Response

Table 4 Parameter description

Parameter

Type

Description

id

String

Domain ID

url_domain

String

Domain name

status

Integer

CNAME resolution status

ssl_id

String

Certificate ID

ssl_name

String

Certificate name

Example response:
{
	"id": " b9be707660c5406394f8973e087bae20",
	"url_domain": "www.example.com",
	"status": 3,
	"ssl_id ": "0a515af69f4e4dcca84fbf85f68c0e27",
"ssl_name": "Certificate"
}

Status Codes

Table 5 Status codes

Status Code

Description

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Server Internal Error