Iván San Román, from the Flat 101 Development team , defines the API as an abstraction layer (interface), a set of rules that define how to carry out communications between two systems. In the web field, it could be said that it is a backend service used to connect two applications.
This interface works through requests and responses. When using the front end of the website, the user sends requests to the server and the server responds with all the data necessary to display the requested information. This information is obtained in JSON format, which is transformed to make it more user-friendly.
Transfer. It adds a very thin estonia number data layer of complexity and abstraction to HTTP. While HTTP is file transfer, REST is based on resource transfer. For the API to be considered Restful it must include at least 4 methods that allow obtaining, creating, updating and deleting objects. These methods are standard and are named as follows: Get, Post Put and Delete, in this way and by attaching the task to be performed to the request, the server interprets it and the database is modified.
What is a decoupled development (front (ReactJS) and back (WP) go independently) they communicate via Rest API
A decoupled development consists of developing the backend and the frontend independently. For example, you can develop the backend by making the most of the WordPress API and its administration panel to control the website, but the front end that the website users see is developed, for example, with a Framework such as ReactJS. This is possible because you can create more dynamic designs than if you used the default themes or modified themes available in WordPress.
This communication between the front and back would be possible by accessing the WordPress API through the default endpoints or by creating the endpoints that we need if it is a more complex development and adapted to our needs. In points 3 and 4 you can see how to access the endpoints that WordPress offers and how to create your own to adapt it to your needs.
Default WP Endpoint
When creating a WordPress, it generates a series of endpoints to be able to perform certain actions if you decide to use a frontend framework . Below, we leave you the list of endpoints that it creates along with the route to access them: