Create Domain

This API is used to create website acceleration domain.

1. Request Definition

  • API URL
https://cdn-api.swiftfederation.com/v1.0/domains
  • Request Method
POST
  • Request Header

Refer to HTTP Request Headers

  • Request Body

Request Body Data Format: JSON

Field Required Type Description
name Mandatory string Domain name.
customerId Mandatory int Customer ID of this domain.
originUrl Mandatory string IP or domain name of origin server.
originProtocol Optional string Http/Https protocol that edge server will use to fetch contents from origin server. Value should be http, https or same_as_client. It will use client protocol if pass null or do not pass this field.
streamingService Optional boolean To indicate if need to combine multiple requests as one request to origin server. true: Enabled, false: Disabled. Default is false.
http2 Optional boolean Enable HTTP/2 will allow client connect CDN by HTTP/2. Note: Please configure SSL certificate before you use HTTP/2. true: Enabled, false: Disabled. Default is false.
redirectHttpToHttps Optional boolean Whether redirect all plain http requests to https. true: Enabled, false: Disabled. Default is false.
active Optional boolean To indicate if service is enabled or disabled. true: Enabled, false: Disabled. Default is true.
  • Request Body Example
{
    "name": "cdn.website2.com",
    "customerId": 11,
    "originUrl": "origin2.website2.com",
    "originProtocol": "http",
    "streamingService": true,
    "http2":true,
    "redirectHttpToHttps":true,
    "active": true
}


2. Response Definition

  • Response Header

Refer to HTTP Response Headers

  • Response Body
Field Type Description
id int Service ID number.
name string Domain name.
customerId int Customer ID of this domain.
originUrl string IP or domain name of origin server.
deliveryDomain string Delivery domain which will be CName to.
streamingService boolean true: Enabled, false: Disabled.
http2 boolean true: Enabled, false: Disabled. If the value is not set, the default value will be used.
redirectHttpToHttps boolean Whether redirect all plain http requests to https. true: Enabled, false: Disabled. Default is false. If the value is not set, the default value will be used.
active boolean true: Enabled, false: Disabled.
  • Response Body Example
{
    "id": 101,
    "name": "www.website1.com",
    "customerId": 11,
    "originUrl": "1.2.3.4",
    "originProtocol": "http",
    "deliveryDomain": "edge.swiftserve.com",
    "streamingService": true,
    "http2":true,
    "active": true
}
           Updated 2020-06-18 07:16:20

results matching ""

    No results matching ""