What is a REST API?
API is short for Application Programming Interface and comprises a set of rules letting programs communicate with each other. REST stands for REpresentational State Transfer.
A REST API allows a client to request information from a server using HTTP commands in a similar way to requesting data from a web site. The server in this context is the EK80 software. The communication is standardized and includes features such as scalability and statelessness. As the complexity of the service grows you can easily make modifications and don't have to keep track of the state of the data across client and server.
The REST APIs communicate using specific ports. There are two REST APIs described for the EK80.
•  EK80 REST API for remote control
This API is used for setting and receiving simple data and intended for test purposes only. This is a beta-version.
•  EK80 REST API for subscription.
This is an alpha-version.
They are both currently configured for use within a single computer.
Note
The REST API is currently under development and only limited support is provided.
Request and response using HTTP
The request and response is delivered using standard HTTP. The requests available are:
•  Get
•  Post
•  Put
•  Patch
•  Delete
For EK80 systems the form-ended requests returns JSON-encoded (Javascript Object Nation) responses. The HTTP standard is open for other formats as well.
Based on these requests your client can receive and manipulate data in the EK80 system.
Endpoints
An API endpoint is the point of entry in a communication channel when two systems are interacting. It refers to touchpoints of the communication between an API and a server. The location where the API sends a request and where the response emanates is called an endpoint.
Error codes - quick summary
The API uses conventional HTTP response codes to indicate success or failure of an API request.
•  2xx range indicate success
•  4xx range indicate an error that failed given the information provided (a required parameter was omitted)
–  400 - Bad Request: The request was unacceptable, often due to missing required parameter.
–  401 - Unauthorized: No valid API key provided.
–  402 -Request Failed: The parameters were valid but the request failed.
–  404 - Not Found: The requested resource doesn't exist.
–  409 - Conflict: The request conflicts with another request (perhaps due to using the same idempotent key).
–  429 - Too Many requests: Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
•  5xx range indicates error with the servers.
–  500, 502,503, 504 - Server Errors: Something went wrong on the server side.