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
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | The unique identifier of the certificate to attach. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| certificateId | Integer | Mandatory | Certificate id. |
| domainName | String | Mandatory | The domain name is one of the domains associated with the serviceId. |
Response
Status Codes, Error Codes and Error Messages
| Status Code | Error Code | Error Message |
|---|---|---|
| 400 | Request.BadRequest | Bad request. |
| 400 | InvalidCustomer.IdEmpty | Customer id can be empty or invalid. |
| 400 | InvalidService.IdIncorrect | Service id is empty or invalid. |
| 400 | InvalidService.IdPermission | ServiceId can not be found or unknown. |
| 400 | InvalidCertificate.Id | The CertificateId is empty or invalid. |
| 400 | InvalidCertificate.DomainNameEmpty | Domain 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