以下 API 皆需 API Token 相關 Header
GET /api/v1/user/site/{siteID}/domains
根據站點 ID 取得此站點下的所有域名列表
curl --request GET \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
{CDNRay API Endpoint}/api/v1/user/site/{siteID}/domains?page=1&pageSize=10
{
"code": 101001,
"total": 2,
"data": [
{
"createdAt": "2023-08-17T15:46:36.461+08:00",
"updatedAt": "2023-08-17T15:46:36.461+08:00",
"id": 8,
"name": "kk2k.com",
"scheme": 0,
"autoSSL": false,
"hsts": false,
"forceSSL": false,
"hashType": 0,
"failTimeOut": 0,
"maxFails": 0,
"portMap": false,
"hostName": "",
"tags": [],
"status": 1,
"cnameStatus": 0,
"certificateID": 0,
"certificateName": "",
"certificateAutoStatus": 0,
"certificateMemo": "",
"upstreamURL": "1.1.1.1:80",
"upstreamCount": 1,
"customHeaderModuleID": 0,
"customHeaderModuleName": "",
"urlRedirectModuleID": 0,
"urlRedirectModuleName": ""
}
]
}
POST /api/v1/user/site/{siteID}/domains
根據站點 ID 新增數個域名
curl --request POST \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"domains": [
{
"name": "kkk.com",
"scheme": 0,
"autoSSL": false,
"forceSSL": false,
"portMap": false,
"tags": [],
"status": 1,
"certificateID": 0,
"customHeaderModuleID": 0,
"upstreams": [
{
"ip": "1.1.1.1",
"port": 80,
"weight": 1
}
]
}
]
}' \
{CDNRay API Endpoint}/api/v1/user/site/{siteID}/domains
{
"domains": [
{
"name": "kkk.com",
"scheme": 0,
"autoSSL": false,
"forceSSL": false,
"portMap": false,
"tags": [],
"status": 1,
"certificateID": 0,
"customHeaderModuleID": 0,
"upstreams": [
{
"ip": "1.1.1.1",
"port": 80,
"weight": 1
}
]
}
]
}
{ "code": 101001 }
PUT /api/v1/user/site/{siteID}/domain
根據站點 ID 更新指定 ID 的域名
curl --request PUT \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data ' {
"id": 7,
"name": "kkk.com",
"autoSSL": false,
"forceSSL": false,
"certificateID": 0,
"hostName": "kkk.com",
"status": 0,
"customHeaderModuleID": 0,
"urlRedirectModuleID": 0
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/domain'
{
"id": 7,
"name": "kkk.com",
"autoSSL": false,
"forceSSL": false,
"certificateID": 0,
"hostName": "kkk.com",
"status": 0,
"customHeaderModuleID": 0,
"urlRedirectModuleID": 0
}
{ "code": 101001 }
DELETE /api/v1/user/site/{siteID}/domains
根據指定的 IDs 刪除複數域名
curl --request DELETE \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{ "ids":[1,2,3,8] }' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/domains'
{ "ids":[1,2,3,8] }
{ "code": 101001 }