Introduction
Application Programming Interface (API) is a software/connection between two applications allowing them to exchange information.
How does that work?
ONe API is not much different from the others. There is a division into categories (resources) on individual micro servers. Each resource has its own functions. The function description describes the general resource and the individual endpoint.
βResourcesβ refers to the information returned by an API. There are several endpoints for accessing a resource, as well as multiple methods for each endpoint.
Here is an example of a description (red color):
Endpoints
Endpoints indicate how to get to a specific resource, and the function indicates what interactions can be used. A single resource often has a number of related endpoints, each with its own set of pathways and methods but all delivering different information about the same thing. The endpoint also only displays the end path of a resource URL, not the base path shared by all endpoints.
ONe API follows the principle of placing the method next to endpoints. The method determines the possible operation that can be executed by the given function.
Parameters
Parameters are choices you can send to the endpoint to modify the response (for example, selecting the response format or the amount returned). Parameters can be divided into three categories: header parameters, path parameters, and query string parameters. Next to the parameters there is always a short description.
Under the name of the parameter there is always the data type of the parameter. APIs may not process the parameter correctly if itβs the wrong data type or wrong format.
- string: An alphanumeric sequence of letters and/or numbers
- integer: A whole number β can be positive or negative
- boolean: True or false value
- object: Key-value pairs in JSON format
- array: A list of values
Header parameters - Parameters included in the request header, usually related to authorization.
Path parameters - Parameters within the path of the endpoint, before the query string.
Query parameters - Parameters in the query string of the endpoint.
Response codes
HTTP Status Code | Text | Description |
400 | Request is invalid | The request was invalid. It may occur for various reasons - a malformed JSON or a violated rule |
500 | Server error | An internal API error occurred. Don't worry, we track and verify all such errors and try to react as asap as possible. |
404 | Not Found | The requested resource could not be found. |
Functions
GET - Retrieves the resource
POST - Creates a resource
PUT - Updates or creates within an existing resource
DELETE - Removes the resource