EdgeNext
Documentation home

EdgeNext Documentation

Product guides, setup instructions, and technical references.

CDN

Create Domain

API Endpoint

Request URL: domain (POST)

API Request Domain: cdn.api.edgenext.com
API Version: v2

API Description

This API is used to create an accelerated domain. It also supports configuring additional features, including the origin server address and origin host.

Note:
When this API is called by special accounts, the user_id request parameter must be included. Otherwise, the request will fail with the error message: user_id is require.

Please contact the project manager to request access if this feature is required.

Request Parameters

Common Parameters

The user's authentication token is required. Please contact the on-call support team to obtain a valid token.

POST Request Parameters

The request body supports the following formats: form-data, x-www-form-urlencoded, and JSON.

Parameter Name Data Type Required Description
domain string Yes The accelerated domain name to be created.
area string No Specifies the acceleration region. mainland_china: Mainland China outside_mainland_china: Outside Mainland China global: Global rim: RIM If the selected acceleration region is not included in the contract, domain creation will fail.
type string Yes Specifies the domain type. page: Web page download: Download video_demand: Video on demand dynamic: Dynamic content scdn: SCDN total_station: Whole site upload: Upload
config array Yes Feature configuration settings. Supports origin server configuration and origin host configuration.

config Parameter Description

origin (Origin Configuration)

Parameter Name Data Type Required Description
default_master string Yes Primary origin server. Supports IP addresses and domain names. Multiple values should be separated by commas (,). Example: "133.233.133.33,133.233.22.33" A maximum of 6 IP addresses can be configured for primary and backup origins combined.
default_slave string No Backup origin server. Supports IP addresses and domain names. Multiple values should be separated by commas (,). Example: "133.233.133.33,133.233.22.33" Note: The primary and backup origins cannot be identical, and the backup origin cannot contain the same addresses as the primary origin.
origin_mode string No Specifies the origin protocol and port mode. default: Use the same protocol and port as the client request when accessing the origin. http: Use HTTP protocol with port 80 for origin requests. https: Use HTTPS protocol with port 443 for origin requests. custom: Use a custom protocol and port. The ori_https and port parameters must be configured. Default value: default.
ori_https string Yes Required when origin_mode=custom. Specifies whether HTTPS is used for origin requests. yes: HTTPS origin request no: HTTP origin request
port int Yes Required when origin_mode=custom. Specifies the origin port. Valid range: 0-65535.

origin_host (Origin Host Configuration)

Parameter Name Data Type Required Description
host string Yes Specifies the origin host.

Request Example

curl -X POST "https://cdn.api.edgenext.com/v2/domain?token=xxx"\
    -H "Content-Type: application/json"\
    -d '{
    "domain":"example.com",
    "type":"page",
    "config":{
        "origin":{
            "default_master":"1.1.1.1"
        },
        "origin_host":{
            "host":"test.qingcdn.com"
        }
    }
}'

Response Example

JSON format

{
    "code": 0, // code=0 indicates that the request was successful. Non-zero values indicate an error.
    "data": {
        "id": "2729151231",
        "domain": "example.com",
        "type": "page",
        "status": "deploying",
        "cname": "example.com.qingcdn.com.",
        "config": {
            "origin": {
                "default_master": "1.1.1.1."
            },
            "origin_host": {
                "host": "test.qingcdn.com"
            }
        }
    }
}

Response Headers

HTTP/1.0 200 OK

Api-Id:                100438085
Content-Type:          application/json; charset=utf-8
X-Ratelimit-Grad:      minute
X-Ratelimit-Limit:     100
X-Ratelimit-Remaining: 100
X-Retry-After:         1

Need help? Contact our support team at support@edgenext.com.

Back to documentation home