以下 API 皆需 API Token 相關 Header
GET /api/v1/user/site/{siteID}/certificates
根據站點 ID 取得此站點下的所有證書列表
curl --request GET \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/certificates'
{
"code": 101001,
"total": 1,
"data": [
{
"createdAt": "2023-08-18T10:17:09.159+08:00",
"updatedAt": "2023-08-18T10:17:09.159+08:00",
"id": 2,
"name": "example.com",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICvDCCA...X9maZhPp+6QIDAQAB\n-----END CERTIFICATE REQUEST-----",
"key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqh...QeCv74WZ379maZhPp\n-----END PRIVATE KEY-----",
"isAuto": false,
"inUseCount": 1,
"memo": ""
}
]
}
POST /api/v1/user/site/{siteID}/certificate
根據站點 ID 新增一個證書
curl --request POST \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"name": "example.com",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICvDCCA...X9maZhPp+6QIDAQAB\n-----END CERTIFICATE REQUEST-----",
"key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqh...QeCv74WZ379maZhPp\n-----END PRIVATE KEY-----",
"domainIDs":[7]
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/certificate'
{
"name": "example.com",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICvDCCA...X9maZhPp+6QIDAQAB\n-----END CERTIFICATE REQUEST-----",
"key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqh...QeCv74WZ379maZhPp\n-----END PRIVATE KEY-----",
"domainIDs":[7]
}
{ "code": 101001 }
PUT /api/v1/user/site/{siteID}/certificate
根據站點 ID 更新指定 ID 的證書
curl --request PUT \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"name": "example.com",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICvDCCA...X9maZhPp+6QIDAQAB\n-----END CERTIFICATE REQUEST-----",
"key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqh...QeCv74WZ379maZhPp\n-----END PRIVATE KEY-----",
"domainIDs":[7],
"id":2,
"needUpdateCertificates":false
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/certificate'
{
"name": "example.com",
"csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIICvDCCA...X9maZhPp+6QIDAQAB\n-----END CERTIFICATE REQUEST-----",
"key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqh...QeCv74WZ379maZhPp\n-----END PRIVATE KEY-----",
"domainIDs":[7],
"id":2,
"needUpdateCertificates":false
}
{ "code": 101001 }
DELETE /api/v1/user/site/{siteID}/certificates
根據指定的 IDs 刪除複數域名
curl --request DELETE \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"ids":[2]
}' \
'{CDNRay API Endpoint}/api/v1/user/$siteID/certificates'
{ "ids":[2] }
{ "code": 101001 }