APIセンター

CreateCustomAction

更新時間: 2025-09-05 10:38:47

Create a custom action,up to 5 custom response actions can be configured.

  • 単一ユーザーの使用頻度: 300/5min
  • 使用できるプロダクト: Cloud Security 2.0,Flood Shield 2.0
API認証の詳細については、以下を参照してください:API認証の概要

リクエストパラメータ

リクエストヘッダ

パラメータ名説明
serviceTypeString
Security service type. Please enter a specific service type, if you purchase multiple security services.

Body パラメータ

パラメータ名説明
*actionNameString
Action name,maximum 50 characters. Does not support # and &.
descriptionString
Description,maximum 200 characters.
*statusCodeString
Status code. Valid value range:200,204,206,400,401,403,404,500,501,503.
*contentTypeString
Response Content-Type type,multiple separated by ; sign.
*cusBlockCntString
Response content definition, the size of the response content cannot exceed 16KB, if you need to insert static resources such as pictures, it is recommended to use links to import. The following interception information parameters are supported: {url} : Displays the URL information when intercepting {client_ip} : Displays the intercepted user IP information {time} : Displays the intercepted time point {event_id} : Displays the ID information of this interception event

レスポンスパラメータ

Body パラメータ

パラメータ名説明
codeString
Please refer to the error code for exceptions.
msgString
Description.
dataString
Customize response ID.

エラーコード

エラーコード(code)説明(message)HTTPステータスコード意味
40010Request\nparameter\nerror.200Request\nparameter\nerror.
500Server\nerror.200Server\nerror.

入力例

JSON
JSON
リクエスト例
コピー コピー完了
#!/bin/bash
username="example_username"
# Note that this must be a single quote to avoid the special $ character
apiKey='example_apiKey'
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`

curl -i --url "https://api.cdnetworks.com/api/v1/share-action/add-customize-act" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
    "actionName": "CustomProcessingActionName",
    "description": "Custom processing action description",
    "statusCode": "500",
    "contentType": "application/json",
    "cusBlockCnt": "Customize response page content"
}'
レスポンス例
コピー コピー完了
{
  "code" : 200,
  "msg" : "Success",
  "data" : "1234567890123456789"
}