Request in depth

General Get/Retrieve request

Show/Hidden html5 code
View source
 
http://api.domainapi.com/v1/service/domain?optional_param1=values1&optiona2_param2=value2
 
service:
description: name of requested service
example: whois, availability, semantic
domain:
description: name of requested service
example: example.fr, example
parameters:
description: list of specific service parameters (cf. specific service documentation)

General Post/Create, Put/Update, Delete request

Show/Hidden html5 code
View source
 
http://api.domainapi.com/v1/service/domain
 
service:
description: name of requested service
example: whois, availability, semantic
domain:
description: name of requested service
example: example.fr, example
parameters:
description: a JSON object with specifics parameters must be contained in header of HTTP request (cf. specific service documentation)

Returned type

To define the response's type, specify it in the URL (JSON if not specified).

Show/Hidden html5 code
View source
 
http://api.domainapi.com/v1/service/type/domain
 
type:
description: type of response
Possible values
  • json : return an application/json
  • xml : return an application/xml
  • rt : return an application/octet-stream in real time

Analyze the result

Let's start with the study of the structure of a standard response. Bellow a sample of availability result:

Show/Hidden javascript code
View source
 
  {
    "service":"availability",
    "domain":"example.com",
    "timestamp":1234567890,
    "content":{
      "domainList":[
        {
          "status":"taken",
          "name":"example.com"
        }
      ]
    }
  }
 

Show/Hidden xml code
View source
 
<?xml version="1.0" encoding="UTF-8" ?>
  <response>
    <service>availability</service>
    <domain>example.com</domain>
    <timestamp>1234567890</timestamp>
    <content>
      <domainList>
        <domain>
          <status>taken</status>
          <name>example.com</name>
        </domain>
      </domainList>
    </content>
  </response>
 

On all the responses, the preambule is the same, that is to say service, domain, timestamp and content field. This fields will always returned whatever the requested services.

service
the name of the requested service
domain
the domain name subject of the request
timestamp
creation date of the result message
content
generic container for specific data of the requested service

Additional information