Attach Certificate to Domain
Attaches a certificate to a domain for website acceleration. When attaching a new certificate to a domain with a certificate, the new certificate will override the old certificate.
Request
Request-Line
POST /cdn/v1.0/services/{serviceId}/certificates HTTP/1.1
Request Parameters
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| serviceId | Integer | Mandatory | Service ID. |
Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| certificateId | Integer | Mandatory | Certificate ID. |
| domainName | String | Mandatory | The domainName 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 | ServiceId.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.swiftfederation.com"
}
Successful Response Body
HTTP/1.1 200