Making a Request
Below we have provided all the information you need to manually form an API request without using one of the above API wrappers.
You can make your API requests via HTTP
POST requests starting from the following endpoint:
For the security of your account, we only allow API requests to be made over HTTPS; any HTTP requests will fail outright.
Calling an API Method
API modules are subdirectories within the endpoint, and the method you are calling is the page you are requesting. For example, if you are using the
server.list action, your request URL might look like this:
We currently support the following response formats:
- JSON (.json)
- XML (.xml)
- Yaml (.yml)
Simply append the appropriate file extension to the API request:
https://api.hostdime.com/v1/server/list.json https://api.hostdime.com/v1/ticket/create.xml https://api.hostdime.com/v1/vps/stop.yml
Our API supports JSONP, simply add a
callback parameter to a JSON request to generate a JSONP response.
Any parameters to the request are simply provided as HTTP
POST request parameters. An easy way to try this out is to use the utility.echo action:
POST /v1/utility/echo.json HTTP/1.1 Host: api.hostdime.com foo=bar&faz=baz
There are a few parameters that are required to make a restricted API request.
|api_key||Your PUBLIC API key|
|api_timestamp||The current Unix time (UTC)|
|api_unique||A string unique to the request, to prevent duplicate requests|
|api_hash||A specially formed hash of the API request. More details on its implementation below.|
Generating the API Hash
In order to generate the
api_hash parameter, concatenate the fields in the following order with a colon, and then generate an SHA256 hash of the result:
- The Unix timestamp you provided with
- The unique identifier you provided with
- Your PRIVATE key
- The API method, like
- A JSON encrypted string, of your JSON encrypted parameters object, in the order provided in the HTTP query, excluding any parameters prefixed with
So for the following request, assuming your public key is
foobar and private key is
POST /v1/domain/list.json HTTP/1.1 Host: api.hostdime.com status=registered&order=desc&api_key=foobar&api_timestamp=1369758680&api_unique=ABCDEF
The concatenated string would be:
And the resultant SHA256 hash would be:
So your final request would look like:
POST /v1/domain/list.json HTTP/1.1 Host: api.hostdime.com status=registered&order=desc&api_key=foobar&api_timestamp=1369758680&api_unique=ABCDEF&api_hash=499b5d8b8bce0f66d829d9186fb475c16b505ef7e6238c3b43c3342902ce27dd
To avoid having to write all of this manually, we suggest using one of our provided API wrappers.