DNS API
E2E Networks DNS API will help you to create, update and get DNS records of your domain.
DNS must be configured with perfect precision if any inaccuracy in setting up the DNS record may lead to the inefficient performance of your website.
Domain List
Request Method: GET Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward?apikey={{api_key}}
CURL
curl --location --request GET 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1Ni........' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR.......',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5c........s',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO.......',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO.......',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI.......',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIg........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Response Body
{
"code": 200,
"data": [
{
"id": 4732,
"domain_name": "teststaging1.com.",
"domain_ip": "2.1.3.4",
"validity": null,
"created_at": "2020-12-03T11:22:52.468327Z",
"deleted": false
}
],
"errors": {},
"message": "Success"
}
Add Domain
Request Method: POST Content-Type: application/json Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
Domain Name i.e teststaging1.com |
True |
ip_addr |
String |
IP Address i.e 2.1.3.4 |
True |
Response Body
{
"domain_name":"teststaging1.com", Mandatory
"ip_addr":"2.1.3.4" Mandatory
}
Response
{
"code": 200,
"data": {
"status": true,
"message": "The domain was created successfully!",
"data": null
},
"errors": {},
"message": "Success"
}
CURL
curl --location --request POST 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6.......' \
--header 'Content-Type: application/json' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9' \
--data-raw '{
"domain_name":"teststaging1.com",
"ip_addr":"2.1.3.4"
}'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"domain_name":"teststaging1.com",
"ip_addr":"2.1.3.4"
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5c......',
'Content-Type: application/json',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5c......',
'Content-Type' => 'application/json',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$request->setBody('{
\n "domain_name":"teststaging1.com",
\n "ip_addr":"2.1.3.4"
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}');
$request->setRequestMethod('POST');
$body = new http\Message\Body;
$body->append('{
"domain_name":"teststaging1.com",
"ip_addr":"2.1.3.4"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiS.......',
'Content-Type' => 'application/json',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}',
'headers': {
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkI.........',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({"domain_name":"teststaging1.com","ip_addr":"2.1.3.4"});
req.write(postData);
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}',
'headers': {
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJ........',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
body: JSON.stringify({"domain_name":"teststaging1.com","ip_addr":"2.1.3.4"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('POST', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?&apikey={{api_key}}')
.headers({
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiw........',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.send(JSON.stringify({"domain_name":"teststaging1.com","ip_addr":"2.1.3.4"}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
DELETE Domain
Request Method: DELETE Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward?apikey={{api_key}}&domain_id=105
Name |
Type |
Description |
Required |
---|---|---|---|
domain_id |
Integer |
Domain Id which will delete or remove |
True |
Response Body
{
"code": 200,
"data": {
"status": true,
"message": "The domain was deleted successfully",
"data": null
},
"errors": {},
"message": "Success"
}
CURL
curl --location --request DELETE 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?domain_id=105' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsIn........' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?domain_id=105',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5c..........',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?domain_id=105');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?domain_id=105');
$request->setRequestMethod('DELETE');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI.............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'DELETE',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward/?domain_id=105',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI...........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?domain_id=105',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5...............',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('DELETE', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/?domain_id=105')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5.............',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
View DNS Record
Request Method: GET Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./?apikey={{api_key}}
Request Parameter
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
Domain Name which record will show |
True |
Response Body
{
"code": 200,
"data": {
"domain_name": "teste2e.com.",
"domain": {
"account": "",
"dnssec": false,
"id": "teste2e.com.",
"kind": "Native",
"last_check": 0,
"masters": [],
"name": "teste2e.com.",
"notified_serial": 0,
"rrsets": [
{
"comments": [],
"name": "teste2e.com.",
"records": [
{
"content": "staging-dns.e2enetworks.net. abuse.e2enetworks.net.in. 2020111204 10800 3600 604800 86400",
"disabled": false
}
],
"ttl": 86400,
"type": "SOA"
},
{
"comments": [],
"name": "teste2e.com.",
"records": [
{
"content": "staging-dns.e2enetworks.net.",
"disabled": false
}
],
"ttl": 86400,
"type": "NS"
},
{
"comments": [],
"name": "teste2e.com.",
"records": [
{
"content": "1.2.3.2",
"disabled": false
}
],
"ttl": 14400,
"type": "A"
},
{
"comments": [],
"name": "www.teste2e.com.",
"records": [
{
"content": "1.2.3.2",
"disabled": false
}
],
"ttl": 14400,
"type": "A"
},
{
"comments": [],
"name": "teste2e.com.",
"records": [
{
"content": "10 teste2e.com.",
"disabled": false
}
],
"ttl": 14400,
"type": "MX"
}
],
"serial": 2020111204,
"soa_edit": "",
"soa_edit_api": "DEFAULT",
"url": "api/v1/servers/localhost/zones/teste2e.com."
},
"domain_ip": "1.2.3.2",
"DOMAIN_TTL": 86400
},
"errors": {},
"message": "Success"
}
CURL
curl --location --request GET 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI............' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO............',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIg................',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cC..............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward/teste2e.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR...............',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5c........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teste2e.com./')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO............',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Verify DNS Name Server
Request Method: GET Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/<domain_name>/?apikey={{api_key}}
Request Parameter
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
Domain Name which record will show |
True |
Response Body
{
"code": 200,
"data": {
"status": false,
"message": "Could not find your domain",
"data": null
},
"errors": {},
"message": "Success"
}
CURL
curl --location --request GET 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiA.........' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO..............',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5c........',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cC.......',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lk.........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ns/e2estaging.com./')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiA......',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Diagnose DNS Validity
Request Method: GET Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/?apikey={{api_key}}
Request Body
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
Domain Name which record will show |
True |
Response Body
{
"code": 200,
"data": {
"status": false,
"message": "Could not find validity for your domain.",
"data": null
},
"errors": {},
"message": "Success"
}
CURL
curl --location --request GET 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiA........' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cC........',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUI........',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI........',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIs............',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cC.........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_validity/test.com.3423443/')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOi.......',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Diagnose TTL
Request Method: GET Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./?apikey={{api_key}}
Request Parameter
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
Domain Name which record will show |
True |
Response Body
{
"code": 200,
"data": {
"status": true,
"message": "Error verifying TTL for your DNS records.",
"data": []
},
"errors": {},
"message": "Success"
}
CURL
curl --location --request GET 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2...........',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO.........',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5.............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5.......',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/diagnostics/verify_ttl/e2estaging.com./')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5c...........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Add DNS Record
Request Method: GET Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./?apikey={{api_key}}
Request Parameter
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
A domain name which DNS record will delete or remove i.e.(teststaging1.com) |
True |
zone_name |
String |
Zone name for domain i.e(teste2e.com.) |
True |
record_name |
String |
Record name for domain i.e(teste2e.com.) |
True |
content |
IP Address |
New Pointed IP Record Of Domain i.e. (122.16.254.87) |
True |
record_type |
String |
Record Type of Domain i.e(“A”) |
True |
Response Body
CURL
curl --location --request GET 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUQ............ ' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR...........',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsI...............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./');
$request->setRequestMethod('GET');
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO..............',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward/e2estaging.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsIn...................',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5....................',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/e2estaging.com./')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR...........',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Response Body
{
"code": 200,
"data": {
"status": true,
"message": "The record was added successfully!",
"data": null
},
"errors": {},
"message": "Success"
}
Update DNS Record
Request Method: PUT Content-Type: application/json Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./?apikey={{api_key}}
Request Parameter
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
A domain name which DNS record will delete or remove i.e.(teststaging1.com) |
True |
zone_name |
String |
Zone name for domain i.e(teste2e.com.) |
True |
record_name |
String |
Record name for domain i.e(teste2e.com.) |
True |
new_record_content |
IP Address |
New Pointed IP Record Of Domain i.e. (122.16.254.87) |
True |
new_record_ttl |
Integer |
Time in seconds to show new record publically |
True |
old_record_content |
IP Address |
Old Pointed IP Record Of Domain i.e. (122.16.254.88) |
True |
record_type |
String |
Record Type of Domain i.e(“A”) |
True |
CURL
curl --location --request PUT 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldU...............' \
--header 'Content-Type: application/json' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9' \
--data-raw '{
"new_record_content": "2.1.3.5",
"new_record_ttl": 14402,
"old_record_content": "2.1.3.4",
"record_name": "teststaging1.com.",
"record_type": "A",
"zone_name": "teststaging1.com."
}'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"new_record_content": "2.1.3.5",
"new_record_ttl": 14402,
"old_record_content": "2.1.3.4",
"record_name": "teststaging1.com.",
"record_type": "A",
"zone_name": "teststaging1.com."
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR................',
'Content-Type: application/json',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgO.............',
'Content-Type' => 'application/json',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$request->setBody('{
\n "new_record_content": "2.1.3.5",
\n"new_record_ttl": 14402,
\n"old_record_content": "2.1.3.4",
\n"record_name": "teststaging1.com.",
\n"record_type": "A",
\n"zone_name": "teststaging1.com."
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./');
$request->setRequestMethod('PUT');
$body = new http\Message\Body;
$body->append('{
"new_record_content": "2.1.3.5",
"new_record_ttl": 14402,
"old_record_content": "2.1.3.4",
"record_name": "teststaging1.com.",
"record_type": "A",
"zone_name": "teststaging1.com."
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIs.........',
'Content-Type' => 'application/json',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'PUT',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward/teststaging1.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiS...........',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({"new_record_content":"2.1.3.5","new_record_ttl":14402,"old_record_content":"2.1.3.4","record_name":"teststaging1.com.","record_type":"A","zone_name":"teststaging1.com."});
req.write(postData);
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'PUT',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI.............',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
body: JSON.stringify({"new_record_content":"2.1.3.5","new_record_ttl":14402,"old_record_content":"2.1.3.4","record_name":"teststaging1.com.","record_type":"A","zone_name":"teststaging1.com."})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('PUT', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI.............',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.send(JSON.stringify({"new_record_content":"2.1.3.5","new_record_ttl":14402,"old_record_content":"2.1.3.4","record_name":"teststaging1.com.","record_type":"A","zone_name":"teststaging1.com."}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Response Body
{
"code": 200,
"data": {
"status": true,
"message": "The record was updated successfully!",
"data": null
},
"errors": {},
"message": "Success"
}
DELETE DNS Record Type
Request Method: DELETE Content-Type: application/json Endpoint: https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./?apikey={{api_key}}
Request Parameter
Name |
Type |
Description |
Required |
---|---|---|---|
domain_name |
String |
A domain name which DNS record will delete or remove |
True |
CURL
curl --location --request DELETE 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./' \
--header 'x-api-key: {{api_key}}' \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5................' \
--header 'Content-Type: application/json' \
--header 'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9' \
--data-raw '{
"zone_name": "mediawowza.tk.",
"record_name": "mediawowza.tk.",
"content": "10.10.10.10",
"record_type": "A"
}'
PHP_CURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_POSTFIELDS =>'{
"zone_name": "mediawowza.tk.",
"record_name": "mediawowza.tk.",
"content": "10.10.10.10",
"record_type": "A"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: {{api_key}}',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiA.............',
'Content-Type: application/json',
'Cookie: sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
PHP_HTTP_REQUEST_2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./');
$request->setMethod(HTTP_Request2::METHOD_DELETE);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5......................',
'Content-Type' => 'application/json',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$request->setBody('{
\n "zone_name": "mediawowza.tk.",
\n "record_name": "mediawowza.tk.",
\n "content": "10.10.10.10",
\n "record_type": "A"
\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
PHP_PECL_HTTP
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./');
$request->setRequestMethod('DELETE');
$body = new http\Message\Body;
$body->append('{
"zone_name": "mediawowza.tk.",
"record_name": "mediawowza.tk.",
"content": "10.10.10.10",
"record_type": "A"
}');
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'x-api-key' => '{{api_key}}',
'Authorization' => 'Bearer eyJhbGciOiJSUzI1NiIsInR5cC.................',
'Content-Type' => 'application/json',
'Cookie' => 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
NodeJS_Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'DELETE',
'hostname': 'api.e2enetworks.com',
'path': '/myaccount/api/v1/e2e_dns/forward/teststaging1.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUI..................',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({"zone_name":"mediawowza.tk.","record_name":"mediawowza.tk.","content":"10.10.10.10","record_type":"A"});
req.setHeader('Content-Length', postData.length);
req.write(postData);
req.end();
NodeJS Request
var request = require('request');
var options = {
'method': 'DELETE',
'url': 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./',
'headers': {
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwi..............',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
},
body: JSON.stringify({"zone_name":"mediawowza.tk.","record_name":"mediawowza.tk.","content":"10.10.10.10","record_type":"A"})
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
NodeJS Unirest
var unirest = require('unirest');
var req = unirest('DELETE', 'https://api.e2enetworks.com/myaccount/api/v1/e2e_dns/forward/teststaging1.com./')
.headers({
'x-api-key': '{{api_key}}',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI...........',
'Content-Type': 'application/json',
'Cookie': 'sessionid=7lv5o4235lrixwzieqs0qbf7s95cqyy1; customer_role_auth=eyJpc19zdGFuZF9hbG9uZV9jdXN0b21lciI6IHRydWUsICJpc19wYXJ0bmVyIjogZmFsc2UsICJpc19wYXJ0bmVyX2N1c3RvbWVyIjogZmFsc2UsICJpc19yb2xlX2VuYWJsZWQiOiB0cnVlLCAiaGlkZV9iaWxsaW5nX2J5X3JvbGUiOiBmYWxzZSwgImlzX3JvbGVfc3VzcGVuZGVkIjogZmFsc2UsICJpc19jdXN0b21lcl9hY3RpdmUiOiB0cnVlLCAiaXNfdmVyaWZpZWQiOiB0cnVlLCAiaXNfc3VzcGVuZGVkIjogZmFsc2V9'
})
.send(JSON.stringify({"zone_name":"mediawowza.tk.","record_name":"mediawowza.tk.","content":"10.10.10.10","record_type":"A"}))
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
Response Body
{
"code": 200,
"data": {
"status": true,
"message": "The record was deleted successfully!",
"data": null
},
"errors": {},
"message": "Success"
}