{"id":23703,"date":"2023-05-09T01:32:24","date_gmt":"2023-05-09T01:32:24","guid":{"rendered":"https:\/\/www.booksofall.com\/in\/?post_type=product&#038;p=23703"},"modified":"2023-05-09T01:32:24","modified_gmt":"2023-05-09T01:32:24","slug":"web-api-design-crafting-interfaces-that-developers-love","status":"publish","type":"product","link":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/","title":{"rendered":"Web API Design &#8211; Crafting Interfaces that Developers Love"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>If you\u2019re reading this, chances are that you care about designing <a href=\"https:\/\/www.w3schools.com\/js\/js_api_intro.asp\">Web API<\/a>s that developers will love and that you\u2019re interested in applying proven design principles and best practices to your Web API.<\/p>\n<p>One of the sources for our design thinking is <a href=\"https:\/\/www.ibm.com\/topics\/rest-apis\">REST<\/a>. Because REST is an architectural style and not a strict standard, it allows for a lot of flexibly. Because of that flexibility and freedom of structure, there is also a big appetite for design best practices.<\/p>\n<p>This e-book is a collection of design practices that we have developed in collaboration with some of the leading API teams around the world, as they craft their API strategy through a design workshop that we provide at <a href=\"https:\/\/docs.apigee.com\/\">Apigee<\/a>.<\/p>\n<p>We call our point of view in API design \u201cpragmatic REST\u201d, because it places the success of the developer over and above any other design principle. The developer is the customer for the Web API. The success of an API design is measured by how quickly developers can get up to speed and start enjoying success using your API.<\/p>\n<p>We\u2019d love your feedback \u2013 whether you agree, disagree, or have some additional practices and tips to add. The<a href=\"https:\/\/groups.google.com\/g\/api-craft\"> API Craft Google Group<\/a> is a place where Web API design enthusiasts come together to share and debate design practices \u2013 we\u2019d love to see you there.<\/p>\n<h2>Are you a <span style=\"font-size: 2rem;\">Pragmatist or a RESTafarian?\u00a0<\/span><\/h2>\n<p>Let\u2019s start with our overall point of view on API design. We advocate pragmatic, not dogmatic REST. What do we mean by dogmatic?<\/p>\n<p>You might have seen discussion threads on true REST &#8211; some of them can get pretty strict and wonky. Mike Schinkel sums it up well &#8211; defining a RESTafarian as follows:<\/p>\n<p><i>\u201cA<\/i>\u00a0RESTifarian<i>\u00a0is a zealous proponent of the REST software architectural style as defined by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Roy_Fielding\">Roy T. Fielding<\/a> in Chapter 5 of his PhD. dissertation at UC Irvine. You can find RESTifarians in the wild on the REST-discuss mailing list. But be careful, RESTifarians can be extremely meticulous when discussing the finer points of REST \u2026\u201d<\/i><\/p>\n<p>Our view: approach API design from the \u2018outside-in\u2019 perspective. This means we start by asking &#8211; what are we trying to achieve with an API?<\/p>\n<p>The API\u2019s job is to make the developer as successful as possible. The orientation for APIs is to think about design choices from the application developer\u2019s point of view.<\/p>\n<p>Why? Look at the<a href=\"https:\/\/online.hbs.edu\/blog\/post\/what-is-value-chain-analysis\"> value chain<\/a> below \u2013 the application developer is the lynchpin of the entire API strategy. The primary design principle when crafting your API should be to maximize developer productivity and success. This is what we call pragmatic REST.<\/p>\n<p id=\"XFYGFkm\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"124\" class=\"alignnone size-full wp-image-23707 \" src=\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/img_64599e870d43d.png\" alt=\"\" \/><\/p>\n<p><b>Pragmatic REST is a design problem\u00a0<\/b><\/p>\n<p>You have to get the design right, because design communicates how something will be used. The question becomes &#8211; what is the design with optimal benefit for the app developer? The developer point of view is the guiding principle for all the specific tips and best practices we\u2019ve compiled.<\/p>\n<h2>Nouns are good; verbs are bad<\/h2>\n<p>The number one principle in pragmatic RESTful design is: keep simple things simple.<\/p>\n<p><b>Keep your base URL simple and intuitive<\/b><\/p>\n<p>The base URL is the most important design affordance of your API. A simple and intuitive base URL design makes using your API easy.<\/p>\n<p>Affordance is a design property that communicates how something should be used without requiring documentation. A door handle&#8217;s design should communicate whether you pull or push. Here&#8217;s an example of a conflict between design affordance and documentation &#8211; not an intuitive interface!<\/p>\n<p>A key litmus test we use for Web API design is that there should be only\u00a0<b>2 base URLs per resource<\/b>. Let&#8217;s model an API around a simple object or resource, a dog, and create a Web API for it.<\/p>\n<p>The first URL is for a collection; the second is for a specific element in the collection.<br \/>\n<span style=\"font-size: 1rem;\">\/dogs\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/dogs\/1234<\/span><\/p>\n<p>Boiling it down to this level will also force the verbs out of your base URLs.<\/p>\n<p><b>Keep verbs out of your base URLs<\/b><\/p>\n<p>Many Web APIs start by using a method-driven approach to URL design. These method- based URLs sometimes contain verbs &#8211; sometimes at the beginning, sometimes at the end.<\/p>\n<p>For any resource that you model, like our dog, you can never consider one object in isolation. Rather, there are always related and interacting resources to account for &#8211; like owners, veterinarians, leashes, food, squirrels, and so on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><iframe style=\"width: 100%; height: 750px; border: none;\" src=\"https:\/\/online.visual-paradigm.com\/share\/book\/web-api-design-crafting-interfaces-that-developers-love-1cg6csqa8d?p=1\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"featured_media":23708,"template":"","meta":{"_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!"},"product_brand":[],"product_cat":[384],"product_tag":[],"class_list":{"0":"post-23703","1":"product","2":"type-product","3":"status-publish","4":"has-post-thumbnail","6":"product_cat-software-architecture","8":"first","9":"instock","10":"shipping-taxable","11":"product-type-simple"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Web API Design - Crafting Interfaces that Developers Love - BooksOffAll Indian<\/title>\n<meta name=\"description\" content=\"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/\" \/>\n<meta property=\"og:locale\" content=\"hi_IN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Web API Design - Crafting Interfaces that Developers Love - BooksOffAll Indian\" \/>\n<meta property=\"og:description\" content=\"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/\" \/>\n<meta property=\"og:site_name\" content=\"BooksOffAll Indian\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"\u0905\u0928\u0941\u092e\u093e\u0928\u093f\u0924 \u092a\u0922\u093c\u0928\u0947 \u0915\u093e \u0938\u092e\u092f\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 \u092e\u093f\u0928\u091f\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/\",\"url\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/\",\"name\":\"Web API Design - Crafting Interfaces that Developers Love - BooksOffAll Indian\",\"isPartOf\":{\"@id\":\"https:\/\/www.booksofall.com\/in\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg\",\"datePublished\":\"2023-05-09T01:32:24+00:00\",\"description\":\"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#breadcrumb\"},\"inLanguage\":\"hi-IN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"hi-IN\",\"@id\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#primaryimage\",\"url\":\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg\",\"contentUrl\":\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg\",\"width\":\"827\",\"height\":\"1169\",\"caption\":\"Web API Design - Crafting Interfaces that Developers Love\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.booksofall.com\/in\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Categories\",\"item\":\"https:\/\/www.booksofall.com\/in\/categories\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Web API Design &#8211; Crafting Interfaces that Developers Love\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.booksofall.com\/in\/#website\",\"url\":\"https:\/\/www.booksofall.com\/in\/\",\"name\":\"BooksOffAll Indian\",\"description\":\"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.\",\"publisher\":{\"@id\":\"https:\/\/www.booksofall.com\/in\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.booksofall.com\/in\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"hi-IN\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.booksofall.com\/in\/#organization\",\"name\":\"BooksOffAll Indian\",\"url\":\"https:\/\/www.booksofall.com\/in\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"hi-IN\",\"@id\":\"https:\/\/www.booksofall.com\/in\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2022\/06\/booksofall-logo-2.png\",\"contentUrl\":\"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2022\/06\/booksofall-logo-2.png\",\"width\":166,\"height\":30,\"caption\":\"BooksOffAll Indian\"},\"image\":{\"@id\":\"https:\/\/www.booksofall.com\/in\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Web API Design - Crafting Interfaces that Developers Love - BooksOffAll Indian","description":"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/","og_locale":"hi_IN","og_type":"article","og_title":"Web API Design - Crafting Interfaces that Developers Love - BooksOffAll Indian","og_description":"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!","og_url":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/","og_site_name":"BooksOffAll Indian","og_image":[{"url":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_image":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg","twitter_misc":{"\u0905\u0928\u0941\u092e\u093e\u0928\u093f\u0924 \u092a\u0922\u093c\u0928\u0947 \u0915\u093e \u0938\u092e\u092f":"4 \u092e\u093f\u0928\u091f"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/","url":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/","name":"Web API Design - Crafting Interfaces that Developers Love - BooksOffAll Indian","isPartOf":{"@id":"https:\/\/www.booksofall.com\/in\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#primaryimage"},"image":{"@id":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#primaryimage"},"thumbnailUrl":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg","datePublished":"2023-05-09T01:32:24+00:00","description":"Web API creation involves developing a set of protocols and tools for building software applications to communicate with each other. Learn more here!","breadcrumb":{"@id":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#breadcrumb"},"inLanguage":"hi-IN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/"]}]},{"@type":"ImageObject","inLanguage":"hi-IN","@id":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#primaryimage","url":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg","contentUrl":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2023\/05\/Web-API-Design-Crafting-Interfaces-that-Developers-Love.jpg","width":"827","height":"1169","caption":"Web API Design - Crafting Interfaces that Developers Love"},{"@type":"BreadcrumbList","@id":"https:\/\/www.booksofall.com\/in\/web-api-design-crafting-interfaces-that-developers-love\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.booksofall.com\/in\/"},{"@type":"ListItem","position":2,"name":"Categories","item":"https:\/\/www.booksofall.com\/in\/categories\/"},{"@type":"ListItem","position":3,"name":"Web API Design &#8211; Crafting Interfaces that Developers Love"}]},{"@type":"WebSite","@id":"https:\/\/www.booksofall.com\/in\/#website","url":"https:\/\/www.booksofall.com\/in\/","name":"BooksOffAll Indian","description":"Biggest IT eBooks library and learning resources - Free eBooks for programming, computing, artificial intelligence and more.","publisher":{"@id":"https:\/\/www.booksofall.com\/in\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.booksofall.com\/in\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"hi-IN"},{"@type":"Organization","@id":"https:\/\/www.booksofall.com\/in\/#organization","name":"BooksOffAll Indian","url":"https:\/\/www.booksofall.com\/in\/","logo":{"@type":"ImageObject","inLanguage":"hi-IN","@id":"https:\/\/www.booksofall.com\/in\/#\/schema\/logo\/image\/","url":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2022\/06\/booksofall-logo-2.png","contentUrl":"https:\/\/www.booksofall.com\/in\/wp-content\/uploads\/sites\/13\/2022\/06\/booksofall-logo-2.png","width":166,"height":30,"caption":"BooksOffAll Indian"},"image":{"@id":"https:\/\/www.booksofall.com\/in\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/product\/23703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/types\/product"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/media\/23708"}],"wp:attachment":[{"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/media?parent=23703"}],"wp:term":[{"taxonomy":"product_brand","embeddable":true,"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/product_brand?post=23703"},{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/product_cat?post=23703"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/www.booksofall.com\/in\/wp-json\/wp\/v2\/product_tag?post=23703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}