Call domainAPI

Introduction

To call the webservice is really easy, because of the uniformed interface access.

A request is always compose by:

  • An HTTP method, which corresponds to an action (e.g: GET, PUT, POST, DELETE)
  • An URL with the service and the domain
  • A list of optional parameters, specific to each service

Choose the action

To begin, choose the HTTP methods that correspond to the action you will make :

  • [GET] you will get information, then make a GET request
  • [PUT] you will put information, then make a PUT request
  • [DELETE] you will delete information, then make a DELETE request

As you can see, HTTP methods are self-explicit and plenty to make all the actions we need.

Build the URL

Second step, choose a service and a domain, and build the corresponding URL.

URL formation :

Show/Hidden html5 code
View source
 
{host}/{service}/{domain}
 

Where :

  • host : currently the host is api.domainapi.com/v1
  • service : name of the service to request
  • domain : name of the domain to apply the service

Example of URL :

Show/Hidden html5 code

View source
api.domainapi.com/v1/availability/example.com

At this step, the request is ready to be sent, but maybe you have to make an advanced availability request which is explained in the next section and will show you how to add parameters.

Add parameters

For each services you can specify some parameters. Depending on the HTTP method, the way to add parameters is different.

For a GET Method, just add parameters in the query string of the URL :

Show/Hidden html5 code
View source
api.domainapi.com/v1/availability/example{?}{field=value&field2=value2}

On this request, we interrogate the service availability of the domain example. In addition, we said that the type is region, and that the regions that we are interested in are EU and ASIA.

Where:

  • ? : indicate the beginning of the query string
  • field=value : field is the name of theparameter and value the value of the parameter.
Show/Hidden html5 code
View source
api.domainapi.com/v1/availability/example?type=region&regions=EU&regions=ASIA

On this request, we interrogate the service availability of the domain example. In addition, we said that the type is region, and that the regions that we are interested in are EU and ASIA.

To conclude

With this information you can interrogate every services.

However, please read the section appropriate to each services, and use specific parameters.

Additional information