Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes the API features that should be standardized across every microservices. Abiding to these conventions is in most cases a requirement, so stick to it!

There are 2 3 parts which are standardized: The format of the request, the format of the response and the format of the url URL of the API endpoint, both all three have their own section on this page.

As a general tip: use your browser's network tracking developer tools to inspect the behavior of what already is!

Table of Contents

Table of Contents
outlinetrue


General API requirements

Each microservice's API should return the data in the same way, defined below:

...

Nico Should propose a format here (smile)(smile)

Request API requirements

...

A request should be a standard HTTP request to one of the endpoints of the microservice as defined by its API. The request should use one of the specified HTTP methods (for example: GET, POST, DELETE, etc.). In addition to this the header 'X-Auth-Token' is required to be (correctly) set for most endpoints.

Getting an X-Auth-Token 

There are several ways to obtain an X-Auth-Token:

Response API requirements

...

The response structures for the successful and unsuccessful request are slightly different.

Successful response

Code Block
languagejs
{
  "success": true,
  "meta": {},
  "data": [],
  "message": "A message to user."
}

...

In the response, either the 'data' or 'message' fields should be presented.

Unsuccessful response

Code Block
languagejs
{
  "success": false,
  "errors": [],
  "message": "An error has occured."
}

...