Knowledgebase: API
I am receiving a 403 - Forbidden error
Posted by Devon Roberts on 15 May 2015 04:54 PM

Requests made with invalid credentials or an invalid x-dnsme-requestDate value will receive an HTTP 403 – Forbidden response.

Every request sent using the API includes a request date header (set by your computers current time). An example would be:

> x-dnsme-requestDate:Tue, 01 Jan 2013 01:10:17 GMT

DNS Made Easy responds with a header that includes a Date (set by our globally synchronized clocks). An example would be:

< Date: Tue, 01 Jan 2013 01:10:17 GMT

If the date/time of the system issuing the API calls is 30 seconds or more off from the API servers date/time this will cause this error. The system time of the server issuing the API calls should be set correctly to prevent this. Here is a full example that shows this:

./dnsmeapi.pl -v http://api.dnsmadeeasy.com/V2.0/dns/managed/123456/records -X GET

* About to connect() to api.dnsmadeeasy.com port 80 (#0)

* Trying 208.94.147.111... connected

* Connected to api.dnsmadeeasy.com (208.94.147.111) port 80 (#0)

> GET /V2.0/dns/managed/1234567/records HTTP/1.1

> User-Agent: curl > Host: api.dnsmadeeasy.com

> Accept: */*

> x-dnsme-apiKey:*********************************

> x-dnsme-hmac:**********************************

> x-dnsme-requestDate:Fri, 25 Jul 2014 12:37:47 GMT

> 55 < HTTP/1.1 200 OK

< Server: Apache-Coyote/1.1

< x-dnsme-requestId: *******************************

< x-dnsme-requestsRemaining: 148

< x-dnsme-requestLimit: 150

< Set-Cookie: *****************************************

< Content-Type: application/json < Transfer-Encoding: chunked

< Date: Fri, 25 Jul 2014 12:37:47 GMT

< * Connection #0 to host api.dnsmadeeasy.com left intact * Closing connection #0 {"data":[{"name":"","value":"1.1.1.1","id":15562953,"type":"A","source ":1,"gtdLocation":"DEFAULT","failed":false,"failover":false,"sourceId" :1234567,"monitor":false,"dynamicDns":false,"ttl":3600,"hardLink":fals e}],"page":0,"totalPages":1,"totalRecords":1}

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).