Skip to main content

Attach Certificate to Domain

This API is used to attach a certificate to a domain for a website acceleration service. When attaching a new certificate to a domain that already has a certificate, the new certificate will override the existing one.

Request

Request-Line

POST /cdn/v1.0/services/{serviceId}/certificates HTTP/1.1

Request Parameters

Path Parameters

ParameterTypeRequiredDescription
serviceIdIntegerMandatoryThe unique identifier of the certificate to attach.

Body Parameters

ParameterTypeRequiredDescription
certificateIdIntegerMandatoryCertificate id.
domainNameStringMandatoryThe domain name is one of the domains associated with the serviceId.

Response

Status Codes, Error Codes and Error Messages

Status CodeError CodeError Message
400Request.BadRequestBad request.
400InvalidCustomer.IdEmptyCustomer id can be empty or invalid.
400InvalidService.IdIncorrectService id is empty or invalid.
400InvalidService.IdPermissionServiceId can not be found or unknown.
400InvalidCertificate.IdThe CertificateId is empty or invalid.
400InvalidCertificate.DomainNameEmptyDomain Name cannot be empty.

Examples

Attach Certificate to Domain

Request

POST /cdn/v1.0/services/228771/certificates HTTP/1.1

{
"certificateId":2978,
"domainName":"2.FlashCone.com"
}

Successful Response Body

HTTP/1.1 200