Creates an edge CNAME.
Although This endpoint creates an edge CNAME, it will not add a CNAME record on a DNS server. This step must be performed before content can be requested through the new edge CNAME.
A request to create an edge CNAME is described below.
HTTP Method | Request URI |
---|---|
POST |
https://api.edgecast.com/v2/mcc/customers/AccountNumber/cnames |
Define the following variable when submitting the above request.
VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). | Description |
---|---|
Required |
|
This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.
Pass the following request body parameters:
Name | Data Type | Description |
---|---|---|
DirPath Required |
String |
Identifies a location on the origin server. This string should specify the relative path from the root folder of the origin server to the desired location. Set this parameter to blank to point the edge CNAME to the root folder of the origin server. |
EnableCustomReports |
Integer |
Determines whether hits and data transferred statistics will be tracked for this edge CNAME. Logged data can be viewed through the Custom Reports module. Valid values are:
|
MediaTypeId Required |
Integer |
Identifies the platform on which the edge CNAME will be created.
|
Name Required |
String |
Sets the name that will be assigned to the edge CNAME. It should only contain lower-case alphanumeric characters, dashes, and periods. The name specified for this parameter should also be defined as a CNAME record on a DNS server. The CNAME record defined on the DNS server should point to the CDN hostname (e.g., wpc.0001.edgecastcdn.net) for the platform identified by the MediaTypeId request parameter. |
OriginId Required |
Integer |
Identifies whether an edge CNAME will be created for a CDN origin server or a customer origin server. Valid values are:
Retrieve a list of customer origin IDs through the |
The response to the above request includes an HTTP status code, response headers, and a response body.
A status code indicates whether the request was successfully performed.
The response for this endpoint only includes standard HTTP response headers.
The response body for a successful request contains the following response parameter:
Name | Data Type | Description |
---|---|---|
CNameId |
Integer |
Indicates the ID assigned to the new edge CNAME. |
The response body for an unsuccessful request may contain an error parameter that provides additional information.
A sample JSON request is shown below.
POST https://api.edgecast.com/v2/mcc/customers/0001/cnames HTTP/1.1
Authorization: TOK:12345678-1234-1234-1234-1234567890ab
Accept: application/json
Content-Type: application/json
Host:api.edgecast.com
Content-Length: 99
{
"DirPath" : "",
"MediaTypeId" : 3,
"Name" : "images.example.com",
"OriginId" : -1
}
A sample JSON response is shown below.
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/json; charset=utf-8
Date: Thu, 15 Apr 2021 12:00:00 GMT
Content-Length: 25
{ "CNameId" : 123456 }
A sample XML request is shown below.
POST https://api.edgecast.com/v2/mcc/customers/0001/cnames HTTP/1.1
Authorization: TOK:12345678-1234-1234-1234-1234567890ab
Accept: application/xml
Content-Type: application/xml
Host:api.edgecast.com
Content-Length: 230
<CustomerCnameParameter xmlns="http://www.whitecdn.com/schemas/apiservices/">
<DirPath/>
<MediaTypeId>3</MediaTypeId>
<Name>images.example.com</Name>
<OriginId>-1</OriginId>
</CustomerCnameParameter>
A sample XML response is shown below.
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/xml; charset=utf-8
Date: Thu, 15 Apr 2021 12:00:00 GMT
Content-Length: 178
<CustomerCnameAddResult xmlns="http://www.whitecdn.com/schemas/apiservices/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <CNameId>123456</CNameId> </CustomerCnameAddResult>