以下 API 皆需 API Token 相關 Header
GET /api/v1/user/site/{siteID}/firewall/setting/blacklists
根據站點 ID 取得此站點下的所有黑名單列表
curl --request GET \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/blacklists'
{
"code": 101001,
"data": [
{
"id": 1,
"ips": [
"1.1.1.1"
],
"url": "kkk.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
]
}
POST /api/v1/user/site/{siteID}/firewall/setting/blacklists
根據站點 ID 新增數個黑名單。
curl --request POST \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"data": [
{
"ips": ["1.1.1.1"],
"url": "kkk.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
]
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/blacklists'
{
"data": [
{
"ips": ["1.1.1.1"],
"url": "kkk.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
]
}
{ "code": 101001 }
PUT /api/v1/user/site/{siteID}/firewall/setting/blacklist
根據站點 ID 更新指定 ID 的黑名單
curl --request PUT \
--header 'Content-Type: application/json' \
--header "SKC-RefreshToken: {Your Refresh Token}" \
--header "SKC-AccessToken: {Your Access Token}" \
--data '{
"id":1,
"ips": [
"1.1.1.1"
],
"url": "kkk2.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}' \
'{CDNRay API Endpoint}/api/v1/user/site/{siteID}/firewall/setting/blacklist'
{
"id":1,
"ips": [
"1.1.1.1"
],
"url": "kkk2.com",
"methods": {
"get": true,
"post": true,
"put": true,
"delete": true,
"head": true,
"patch": true,
"options": true
},
"blockType": 2
}
{ "code": 101001 }
DELETE /api/v1/user/site/{siteID}/firewall/setting/blacklists
根據指定的 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}/firewall/setting/blacklists'
{ "ids":[1,2,3,8] }
{ "code": 101001 }