POST
/api/v1/cdn/distributions/
curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/cdn/distributions/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "source": "cdn", "domain_name": "e2enetworks.com", "origin_details": { "origin_path": "/static", "origin_id": "e2enetworks.com", "ssl_protocol": "TLSv1.2", "protocol_policy": "https-only", "response_timeout": 30, "keepalive_timeout": 5 }, "cache_details": { "viewer_protocol_policy": "https-only", "allowed_http_methods": "GET|HEAD", "min_ttl": 0, "max_ttl": 3153000, "default_ttl": 86400 }, "domain_details": { "http_versions": "http2", "root_object": "", "is_ipv6_supported": false }}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/cdn/distributions/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "source": "cdn", "domain_name": "e2enetworks.com", "origin_details": { "origin_path": "/static", "origin_id": "e2enetworks.com", "ssl_protocol": "TLSv1.2", "protocol_policy": "https-only", "response_timeout": 30, "keepalive_timeout": 5, }, "cache_details": { "viewer_protocol_policy": "https-only", "allowed_http_methods": "GET|HEAD", "min_ttl": 0, "max_ttl": 3153000, "default_ttl": 86400, }, "domain_details": { "http_versions": "http2", "root_object": "", "is_ipv6_supported": False, }, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/cdn/distributions/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "source": "cdn", "domain_name": "e2enetworks.com", "origin_details": { "origin_path": "/static", "origin_id": "e2enetworks.com", "ssl_protocol": "TLSv1.2", "protocol_policy": "https-only", "response_timeout": 30, "keepalive_timeout": 5 }, "cache_details": { "viewer_protocol_policy": "https-only", "allowed_http_methods": "GET|HEAD", "min_ttl": 0, "max_ttl": 3153000, "default_ttl": 86400 }, "domain_details": { "http_versions": "http2", "root_object": "", "is_ipv6_supported": false } }),});console.log(await response.json());Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”project_id
required
integer
Project ID Find your project id here
location
required
string
Deployment region for the resource. Accepted values: Delhi, Chennai.
Mumbai region has been discontinued. Delhi and Chennai are the only supported regions.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
source
string
Example
cdndomain_name
string
Example
e2enetworks.comorigin_details
object
origin_path
string
Example
/staticorigin_id
string
Example
e2enetworks.comssl_protocol
string
Example
TLSv1.2protocol_policy
string
Example
https-onlyresponse_timeout
integer
Example
30keepalive_timeout
integer
Example
5cache_details
object
viewer_protocol_policy
string
Example
https-onlyallowed_http_methods
string
Example
GET|HEADmin_ttl
integer
Example
0max_ttl
integer
Example
3153000default_ttl
integer
Example
86400domain_details
object
http_versions
string
Example
http2root_object
string
Example
is_ipv6_supported
boolean
Example
falseResponses
Section titled “Responses”Distribution creation successful.
Media typeapplication/json
object
code
integer
data
object
message
string
domain_id
string
response_domain
string
resource_type
string
label_id
string
errors
object
key
additional properties
string
message
string
Example
{ "code": 200, "data": { "message": "Your Distribution has been created successfully. It will take upto 30 minutes to deploy. Please wait.", "domain_id": "ENZYVCZPO9X4L", "response_domain": "docs1g047zlrhx.cdn.e2enetworks.net", "resource_type": null, "label_id": null }, "errors": {}, "message": "Success"}