The following sections show more details on how to use the different APIs.
Definitions
An API (Application Programming Interface) is an interface that allows different applications to communicate with each other. You can the API as a "translator" that receives requests from an application, interprets them and then returns the response in the appropriate format. APIs enable a program to interact with external services and access functionality or data that is not within its own code.
An API REST (Representational State Transfer) is a type of API that follows a set of design principles to facilitate communication between applications on the web. These APIs use common HTTP methods, such as GET, POST, PUT and DELETE, to interact with the data. REST is a very popular style of architecture because it allows data to be transferred quickly and easily over the internet.
An endpoint is a specific API URL that represents a resource or service that can be accessed. An endpoint is the "point of contact" that receives requests and returns responses, such as a list of users of an application, information about a product or any other data provided by the API.
For example, in a given API, the endpoint to get a list of users could be https://api.ejemplo.com/usuarios.
Connecting to an API
To connect to an API, three basic elements are required:
- Endpoint URL: the address of the resource to be accessed.
- HTTP method: the type of action to be performed. In the case of the API of this Catalogue only the GET method is required).
- Access credentials (if required): some public APIs require authentication, either via an API key or access tokens. Access credentials are not required to access the MITECO Catalogue API.
For example
The following are examples of how to make a GET query in different programming languages: