{"id":6809,"date":"2021-12-02T07:44:08","date_gmt":"2021-12-02T06:44:08","guid":{"rendered":"https:\/\/immune.institute\/?p=6809"},"modified":"2021-12-02T07:44:08","modified_gmt":"2021-12-02T06:44:08","slug":"api-rest-que-es-y-como-utilizarla","status":"publish","type":"post","link":"https:\/\/immune.institute\/en\/blog\/api-rest-que-es-y-como-utilizarla\/","title":{"rendered":"API Rest: What is it and how to use it?"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">To begin with, before explaining what a Rest API is and how to use it, it is necessary to know what API means:&nbsp;<\/span><\/p>\n<blockquote>\n<p style=\"text-align: center;\"><span style=\"font-weight: 400;\">An API or Application Programming Interface is the set of protocols, definitions, constraints... that are used for the design and integration of application software.<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">In order to develop a web application, it is necessary that both the back-end and the front-end of the computer are connected, to facilitate the exchange of data or the execution of functions, among other actions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So what is Rest from \"API Rest\"? Continue reading this article and we'll explain it all to you:<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Rest: definition<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">First of all, \"Rest\" refers to \"Representational State Transfer\", a concept developed in 2000 by Roy Fielding, the creator of the HTTP specification.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Thus, \"Rest\" is not a software architecture style as such; rather, it defines the constraints that must be taken into account in a software architecture, if we want to create a web application with HTTP.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">These restrictions will obviously be present in the development of the API Rest calls and, in order to implement them, it will be necessary to have the main HTTP methods:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>GET:<\/b><span style=\"font-weight: 400;\"> Access and consultation of information on the resource.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>POST:<\/b><span style=\"font-weight: 400;\"> Creation of a new resource.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>PUT:<\/b><span style=\"font-weight: 400;\"> Updating the existing resource.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>DELETE:<\/b><span style=\"font-weight: 400;\"> Elimination of the given resource.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>PATCH:<\/b><span style=\"font-weight: 400;\"> Modification of an attribute of the resource.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Constraints on the architecture of Rest API services<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">In general terms, the constraints necessary for a Rest architecture are as follows:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Client-server:<\/b><span style=\"font-weight: 400;\"> The applications on the server and for the client are separated. Thus, client and server are loosely coupled. This means that the client does not need to know the implementation details of the server and the server is indifferent as to how the client will use the data.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>No status: <\/b><span style=\"font-weight: 400;\">When each request received by the server is independent and therefore capable of being processed.&nbsp;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Cach\u00e9: <\/b><span style=\"font-weight: 400;\">It is necessary to have a caching system. Caching will prevent repeated connections to request the same resource.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Uniform interface:<\/b><span style=\"font-weight: 400;\"> An interface is uniform when each resource of the Rest service needs a unique URL.<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">So what is an API Rest and what is it for?<\/span><\/h2>\n<blockquote>\n<p style=\"text-align: center;\"><span style=\"font-weight: 400;\">A Rest API (or Restful API) is the type of application programming interface that adapts to the constraints of the Rest architecture and therefore allows the interaction of Restful services.<\/span><\/p>\n<\/blockquote>\n<p><span style=\"font-weight: 400;\">It should also be noted that there are 3 types of API Rest:&nbsp;<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Private:<\/b><span style=\"font-weight: 400;\"> Those intended solely for businesses or <\/span><a href=\"https:\/\/immune.institute\/en\/software-a-medida-cuando-es-recomendable\/\"><span style=\"font-weight: 400;\">specific software<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Semi-open:<\/b><span style=\"font-weight: 400;\"> They are also known as partner APIs. These are those in which several software packages are integrated, where both the company and its business partners have access.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Open:<\/b><span style=\"font-weight: 400;\"> They are freely accessible. They can be accessed by any type of person, so care must be taken. It is recommended that you register so that, in the event of an incident, we can be informed of any changes.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">On the other hand, it should not be forgotten that there is a very wide variety of uses for a Rest API: from social networks such as Twitter, to WordPress plugins, to ecommerces to carry out purchases.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In addition to its flexibility and portability, API Rest adapts to different work platforms, allowing it to be present in different development environments. It is also simple to build and adaptable.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">In short, an API Rest is a means that facilitates communication between different apps, which allows for an exchange of information, as well as adding new functionalities in a secure and fast way.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Get into web development with IMMUNE<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">So now you know, if you can imagine yourself working on the development of an API Rest with <\/span><a href=\"https:\/\/immune.institute\/en\/nodejs-y-por-que-deberias-utilizarlo\/\"><span style=\"font-weight: 400;\">Node.JS<\/span><\/a><span style=\"font-weight: 400;\"> or by becoming an expert in <\/span><a href=\"https:\/\/immune.institute\/en\/proceso-desarrollo-software-ciclo-vida\/\"><span style=\"font-weight: 400;\">software development<\/span><\/a><span style=\"font-weight: 400;\">you will require specific training.&nbsp;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">At IMMUNE we have this <\/span><a href=\"https:\/\/immune.institute\/en\/ingenieria-software\/\"><span style=\"font-weight: 400;\">Degree in Software Development Engineering<\/span><\/a><span style=\"font-weight: 400;\">as well as with our <\/span><a href=\"https:\/\/immune.institute\/en\/bootcamp-full-stack-developer\/\"><span style=\"font-weight: 400;\">Bootcamp in Web Development<\/span><\/a><span style=\"font-weight: 400;\">Find out more about them!<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>Para empezar, antes de explicar qu\u00e9 es una API Rest y c\u00f3mo utilizarla, hay que conocer el significado de API:&nbsp; Una API o Interfaz de Programaci\u00f3n de Aplicaciones es el conjunto de protocolos, definiciones, restricciones\u2026 que se emplean para el dise\u00f1o e integraci\u00f3n del software de las aplicaciones. Y es que para desarrollar una aplicaci\u00f3n [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":7420,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-6809","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts\/6809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/comments?post=6809"}],"version-history":[{"count":0,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/posts\/6809\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/media\/7420"}],"wp:attachment":[{"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/media?parent=6809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/categories?post=6809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/immune.institute\/en\/wp-json\/wp\/v2\/tags?post=6809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}