REST API Basics

Our REST API takes payloads in JSON and returns JSON objects. In our examples we are going to use curl to access the different endpoints. Feel free to use whatever you like for consuming the REST API.

Authentication

Authentication is done by a Basic HTTP Authentication. All interaction with our REST API is secured by SSL. Be sure to send your login credentials with each request.

HATEOAS

Each call to our REST API provides you with an array of hyperlinks that allows you to interact with our system without any previous knowledge.

Most of the endpoints provide at least a relation self which is used to access detailed information about the requested resource.

Base URL

Let us have a look at the initial endpoint of our REST API.

$ curl -u demo:demo https://d9tready.com/rest
{
    "_links": [
        {
            "href": "https://d9tready.com/rest/privatekeys",
            "rel": "privatekeys"
        },
        {
            "href": "https://d9tready.com/rest/certificates",
            "rel": "certificates"
        },
        {
            "href": "https://d9tready.com/rest/balances",
            "rel": "balances"
        },
        {
            "href": "https://d9tready.com/rest/stores",
            "rel": "stores"
        },
        {
            "href": "https://d9tready.com/rest/applications",
            "rel": "applications"
        }
    ]
}

The request above provided us with a list of HATEOAS links. Each link contains the two elements href and rel. href is the URL you should use for subsequent calls to the API. rel is the link relation that describes how it relates to the previous call.

Table Of Contents

Previous topic

Registration

Next topic

Stores and Templates