<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Thiago</title>
    <description>The latest articles on DEV Community by Thiago (@thiagobfim).</description>
    <link>https://dev.to/thiagobfim</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F645396%2F3c6e49ea-b4a3-42c9-8a78-51525fc17d48.jpeg</url>
      <title>DEV Community: Thiago</title>
      <link>https://dev.to/thiagobfim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thiagobfim"/>
    <language>en</language>
    <item>
      <title>Master your API: Naming conventions</title>
      <dc:creator>Thiago</dc:creator>
      <pubDate>Mon, 01 Jul 2024 19:08:56 +0000</pubDate>
      <link>https://dev.to/thiagobfim/master-your-api-naming-conventions-35l6</link>
      <guid>https://dev.to/thiagobfim/master-your-api-naming-conventions-35l6</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmyc1hi5bsby8d0uyqyo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmyc1hi5bsby8d0uyqyo.png" alt="Master your API" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Naming things is probably the most common thing a developer does.&lt;/p&gt;

&lt;p&gt;Naming your API properly is essential to provide clarity and facilitate its usage. Let’s see some best practices for naming REST APIs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Define good resources
&lt;/h3&gt;

&lt;p&gt;The resource represents the data or functionality exposed by the API and is typically identified by unique URIs (Uniform Resource Identifiers).&lt;/p&gt;

&lt;p&gt;When we are talking about REST API defining good resources is essential to avoid confusing APIs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /data -&amp;gt; This endpoint can be a little confusing, it is important to define clear resource names.

✅ /products -&amp;gt; Now is much easier to undestand what is the goal of this resource
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Having deep knowledge of the domain can help a lot in defining good name for the resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use noun
&lt;/h3&gt;

&lt;p&gt;The resources are described by nouns, you should not use verbs. Using verbs goes against the RESTful architectural style, which emphasizes using HTTP methods to represent actions on resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /createUser

✅ /users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use plural
&lt;/h3&gt;

&lt;p&gt;Use plural for the resource name, this is more aligned with RESTful best practices, as we can have a single resource URI that can return a list or a single element.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /user

✅ /users
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use &lt;strong&gt;Hyphens for resources&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The name of the resource should follow the name conventional from &lt;a href="https://www.ietf.org/rfc/rfc1738.txt"&gt;RFC1738&lt;/a&gt;. Using Hyphens improves the readability.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Scheme names consist of a sequence of characters. The lower case letters "a"--"z", digits, and the characters plus ("+"), period ("."), and hyphen ("-") are allowed…”&lt;/p&gt;

&lt;p&gt;RC1738&lt;/p&gt;

&lt;p&gt;To make your URIs easy for people to scan and interpret, use the hyphen (-) character to improve the readability of names in long path segments. Anywhere you would use a space or hyphen in English, you should use a hyphen in a URI&lt;/p&gt;

&lt;p&gt;REST API Design Rulebook - Mark Masse's&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /users/profileSettings

✅ /users/profile-settings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Keep a standard for query parameters
&lt;/h3&gt;

&lt;p&gt;If your API has pagination or a common standard for filter, apply the same query parameter for all endpoints that make sense to have it. This makes your API easier to use and understand.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /users?size=3&amp;amp;page_numer=0
   /products?limit=3&amp;amp;offset=0

✅ /users?page=2&amp;amp;limit=10
   /products?page=0&amp;amp;limit=10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Many guidelines recommend using hyphens for query parameters, while others suggest using camel case. The most important thing is to follow a convention and ensure that this standard is maintained throughout your entire API.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /users/{user_id}
   /products/{productId}

✅ /users/{userId}
   /products/{productId}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Hierarchical URI Structure
&lt;/h3&gt;

&lt;p&gt;Using Hierarchical URI is essential to provide a clean REST API, but it should be used properly to avoid complex hierarchy resources.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ /products-categories

✅ /products/categories
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In case you have a complex hierarchy, with a long chain of nested resources, it can become a problem to use and maintain. In this case, separating the resources can be a better approach.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌/products/{productId}/categories/{categoryid}/reviews/{reviewId}/comments

✅ /reviews/{reviewId}/comments?productId=?&amp;amp;categoryId=?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We’ve seen many good practices related to naming conventional for REST API.&lt;/p&gt;

&lt;p&gt;By following these practices, you guarantee an API easier to use as it is more readable and follows the market standard. Not only that, but your API will also be easier to maintain and involve.&lt;/p&gt;

&lt;p&gt;I hope these tips have been useful to you, and if you know any other tips related to conventional nomenclature, share them here.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/microsoft/api-guidelines/blob/vNext/azure/ConsiderationsForServiceDesign.md#common-names"&gt;Azure Naming Guidelines&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://swagger.io/resources/articles/best-practices-in-api-design/"&gt;Swagger - Best Practices in API Design&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://opensource.zalando.com/restful-api-guidelines/#118"&gt;Zalando - RESTful API and Event Guidelines&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;REST API Design Rulebook - Mark Masse's&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Versioning Your REST API Made Easy: Tips and Tricks</title>
      <dc:creator>Thiago</dc:creator>
      <pubDate>Tue, 14 May 2024 11:10:00 +0000</pubDate>
      <link>https://dev.to/thiagobfim/versioning-your-rest-api-made-easy-tips-and-tricks-5aem</link>
      <guid>https://dev.to/thiagobfim/versioning-your-rest-api-made-easy-tips-and-tricks-5aem</guid>
      <description>&lt;p&gt;Before we start, let’s talk a little bit about what is an API REST and why we should be careful about versioning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Versioning REST API
&lt;/h2&gt;

&lt;p&gt;When you have an API that multiple applications can consume, you should strongly consider using versioning on your APIs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s consider that your API is for a mobile application. If you do not support more than one version of your API, you will obligate the users to keep up with the latest version. In the case of a mobile app, this can be a bit annoying.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s consider that your API is consumed for more than one service.&lt;br&gt;&lt;br&gt;
For example, you create a payment API that is used for more than one microservice. In this case, if you do not use versioning, it may cause break changes in all consumers.&lt;/p&gt;

&lt;p&gt;This is why versioning your API is so important, by doing it, you can ensure that old consumers can still consume your API and have time to migrate to the latest version before it becomes unavailable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Versioning Strategies
&lt;/h2&gt;

&lt;p&gt;There is more than one way to version your REST API, let’s see some strategies and the advantages and disadvantages of each one.&lt;/p&gt;

&lt;h3&gt;
  
  
  URI
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clear and Explicit:&lt;/strong&gt; Version numbers are directly visible in the URI, making it clear and explicit which version of the API is being accessed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Caching:&lt;/strong&gt; URI versioning can leverage HTTP caching mechanisms effectively, as different versions of the API are treated as separate resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bookmarking:&lt;/strong&gt; Consumers can bookmark specific versions of endpoints for future reference or sharing.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Disadvantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pollution of URIs:&lt;/strong&gt; Over time, URI versioning can lead to cluttered URIs, especially if multiple versions of the API are maintained simultaneously.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hard to Change:&lt;/strong&gt; Once a version is included in the URI, it becomes part of the API's public contract and is difficult to change without breaking backward compatibility.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Twitter/X API: Twitter's REST API utilizes URI versioning by incorporating the API version number directly into the URI path. For example, &lt;code&gt;https://api.twitter.com/1.1/statuses/user_timeline.json&lt;/code&gt; represents version 1.1 of the API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;YouTube API utilizes URI versioning, allowing the clients to specify the API version using the “v” URI path. For example: &lt;code&gt;https://www.googleapis.com/youtube/v3/videos?id=7lCDEYXw3mM&amp;amp;key=YOUR_API_KEY&amp;amp;part=snippet,contentDetails,statistics,status&lt;/code&gt; this represents the version v3.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Header
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clean URIs:&lt;/strong&gt; Versioning information is not included in the URI path, keeping URIs clean and focused on resource identification.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility:&lt;/strong&gt; Header versioning allows for more flexibility in API design, as version information is separate from the resource representation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Version Negotiation:&lt;/strong&gt; Clients can negotiate the desired API version using HTTP headers, allowing for dynamic version selection based on client preferences or capabilities.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Disadvantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Less Discoverable:&lt;/strong&gt; Versioning information is not directly visible in the request URI, which may make it less discoverable for developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dependency on Headers:&lt;/strong&gt; Clients must include version information in request headers, which may require additional configuration or code changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;GitHub API: The GitHub API supports header versioning. Clients can specify the desired API version using the &lt;code&gt;X-GitHub-Api-Version&lt;/code&gt; header in HTTP requests. For example, &lt;code&gt;X-GitHub-Api-Version:2022-11-28&lt;/code&gt; indicates the version released on date 2022-11-28 of the GitHub API.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Stripe API: Stripe's REST API allows clients to specify the API version using the &lt;code&gt;Stripe-Version&lt;/code&gt; header in HTTP requests. This approach allows Stripe to introduce breaking changes in newer versions without impacting existing integrations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Query Parameter
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Non-Intrusive:&lt;/strong&gt; Versioning information is included as a query parameter, which is non-intrusive and does not clutter the URI path.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Easy to Implement:&lt;/strong&gt; Adding version information as a query parameter is straightforward and does not require significant changes to existing API endpoints.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Disadvantages&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Caching Challenges:&lt;/strong&gt; Query parameter versioning can lead to caching challenges, as different versions of the same resource may be cached separately.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Potential for Complexity:&lt;/strong&gt; Handling versioning logic in query parameters can introduce complexity, especially for complex APIs with numerous endpoints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Discoverability:&lt;/strong&gt; Versioning information is not directly visible in the URI path, which may impact discoverability for developers exploring the API.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Example
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Google Cloud Translation API: this API utilizes query parameter versioning for the discovery service, where clients can specify the API version using the &lt;code&gt;v&lt;/code&gt; query parameter. For example, &lt;code&gt;https://translate.googleapis.com/$discovery/rest?version=v3&lt;/code&gt; indicates version 3 of this API.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;There are many ways to version your REST API, the most famous is using URI and Header, it is essential to decide on one way and keep it clear for the consumers.&lt;/p&gt;

&lt;p&gt;It is also important to keep your documentation up to date and notify consumers that a new version exists, as well as the deadline for removing the old version, giving consumers enough time to update to the latest version.&lt;/p&gt;

&lt;p&gt;I hope this can help you guarantee that your APIs are backward compatible.&lt;/p&gt;

&lt;p&gt;If this helped you, subscribe to continue receiving more useful content 😊&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.github.com/en/rest/about-the-rest-api/api-versions?apiVersion=2022-11-28"&gt;Github API Versions&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developer.twitter.com/en/docs/twitter-api/getting-started/about-twitter-api"&gt;Twitter API&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://developers.google.com/youtube/v3/getting-started"&gt;YouTube API Data&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://cloud.google.com/translate/docs/reference/rest"&gt;Google Cloud Translation API&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>restapi</category>
      <category>rest</category>
      <category>programming</category>
    </item>
    <item>
      <title>5 Things I wanted to know about REST API when I was starting</title>
      <dc:creator>Thiago</dc:creator>
      <pubDate>Sun, 05 May 2024 16:07:33 +0000</pubDate>
      <link>https://dev.to/thiagobfim/5-things-i-wanted-to-know-about-rest-api-when-i-was-starting-2ook</link>
      <guid>https://dev.to/thiagobfim/5-things-i-wanted-to-know-about-rest-api-when-i-was-starting-2ook</guid>
      <description>&lt;h3&gt;
  
  
  What is a REST API?
&lt;/h3&gt;

&lt;p&gt;API (Application Programming Interface) is a set of routines, protocols, and tools for building software applications.&lt;/p&gt;

&lt;p&gt;REST (Representational state transfer) is an architectural style for distributed hypermedia systems. It was introduced in 2000 by &lt;a href="https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm" rel="noopener noreferrer"&gt;Roy Fielding in his dissertation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So, a REST API or a RESTFul API is an API that implements the REST principles.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. RFC what is it?
&lt;/h3&gt;

&lt;p&gt;RFC stands for "Request for Comments." An RFC is a document that describes various aspects of the design, specifications, and working of the internet and internet-related systems.&lt;/p&gt;

&lt;p&gt;In the context of computer networking and the Internet, an RFC is a type of publication from the Internet Engineering Task Force (IETF) and the Internet Society (ISOC). The RFC documents contain technical specifications and organizational notes for the Internet.&lt;/p&gt;

&lt;p&gt;To know more about RFC access: &lt;a href="https://www.ietf.org/standards/rfcs/" rel="noopener noreferrer"&gt;https://www.ietf.org/standards/rfcs/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are some RFCs that were created to deal with REST, the first one was RFC 2616 created in June 1999 and became obsolete by RFC7230 - RFC7235 created in June 2014, and now these RFCs are also obsolete because of the new RFC9110, RFC9111 and RFC9112 that were created in June 2022.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. What are the most common HTTP Methods?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F54fc5fbd-77bc-4dd8-a4bf-fee397b3de3e_1023x363.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F54fc5fbd-77bc-4dd8-a4bf-fee397b3de3e_1023x363.png" alt="HTTP Methods"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more information, access &lt;a href="https://datatracker.ietf.org/doc/html/rfc9110#section-9" rel="noopener noreferrer"&gt;RFC9110 - HTTP Methods&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. What is idempotent?
&lt;/h3&gt;

&lt;p&gt;An operation is considered &lt;strong&gt;idempotent&lt;/strong&gt; if performing it multiple times has the same effect as performing it once. In other words, no matter how many times you repeat the operation, the system's state remains consistent. This property is crucial for the reliability and predictability of RESTful services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits of Idempotence:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Predictable Behavior:&lt;/strong&gt; Developers can rely on the fact that repeating an idempotent operation won't cause unexpected side effects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Retry Mechanisms:&lt;/strong&gt; Idempotence is useful for designing reliable systems. If a request fails, it can be safely retried without causing unintended changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. What are the most common HTTP Statuses?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;1xx (Informational): The request was received, continuing process&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;2xx (Successful): The request was successfully received, understood, and accepted&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;3xx (Redirection): Further action needs to be taken in order to complete the request&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;4xx (Client Error): The request contains bad syntax or cannot be fulfilled&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;5xx (Server Error): The server failed to fulfill an apparently valid request&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;These are some common HTTP Status:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F832c9c07-f04d-478e-8084-91aecca190fc_1037x616.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F832c9c07-f04d-478e-8084-91aecca190fc_1037x616.png" alt="HTTP Status"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's crucial to know the most common HTTP status codes, as there are over 30 of them. Start by mastering the most common ones to gain a solid foundation in web development.&lt;/p&gt;

&lt;p&gt;To know more about the HTTP status, access the &lt;a href="https://datatracker.ietf.org/doc/html/rfc9110#section-15" rel="noopener noreferrer"&gt;RFC9110 - Status Codes&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. What is the Glory of REST?
&lt;/h3&gt;

&lt;p&gt;Leonard Richardson breaks down the principal elements of a REST approach into three steps:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F5fe98451-9b9b-43b6-a2d7-b21bd971224f_673x398.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fsubstackcdn.com%2Fimage%2Ffetch%2Fw_1456%2Cc_limit%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep%2Fhttps%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F5fe98451-9b9b-43b6-a2d7-b21bd971224f_673x398.png" title="Richardson Maturity Model" alt="Richardson Maturity Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Level 0 (The Swap of POX): At this level there is only one endpoint, and normally it doesn't use HTTP Status, so the API will return 200 OK on all types of responses and the output will contain the error. At this level there is a single HTTP Method, usually POST.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Level 1 (Resources): At this level it will be more than one endpoint, actually one endpoint per resource, but still not using the HTTP Verbs or HTTP Status.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Level 2 (HTTP Verbs): At this level will use the HTTP Verbs and the HTTP Status&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Level 3 (Hypermedia Controls): This is the most mature level of Richardson’s model, in this level the API will use HATEOAS(Hypermedia as the Engine of Application State), which encourages easy discoverability.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to know more about it, read these articles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://martinfowler.com/articles/richardsonMaturityModel.html" rel="noopener noreferrer"&gt;Richardson Maturity Model - Martin Fowler's blog&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://restfulapi.net/resource-naming/" rel="noopener noreferrer"&gt;What is Richardson Maturity Model&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;To write a wonderful API, you must know RFC and best practices. This will help you create an API that follows the common standard, then it will be easy to be a customer of your API.&lt;/p&gt;

&lt;p&gt;Another important thing is to define a REST API design. It will be easier to use your API if you have some well-known design. Try searching for famous APIs and see how they are designed to understand how to do this and what are the best practices.&lt;/p&gt;

&lt;p&gt;Now you know what is an API and what is a REST API, but what I showed here is just the basics concepts, so keep studying 😊&lt;/p&gt;

&lt;h3&gt;
  
  
  References:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;REST API - Design Rulebook&lt;/strong&gt; &lt;strong&gt;-&lt;/strong&gt; Mark Masse&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md" rel="noopener noreferrer"&gt;AZURE API Guidelines&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/" rel="noopener noreferrer"&gt;Best practices for REST API design - Stackoverflow Blog&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://swagger.io/specification/" rel="noopener noreferrer"&gt;Swagger specification&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://restfulapi.net/" rel="noopener noreferrer"&gt;RESTFUL API&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stripe.com/blog/payment-api-design" rel="noopener noreferrer"&gt;Stripe API Design&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>restapi</category>
      <category>java</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
