{"id":1684,"date":"2013-08-14T00:00:00","date_gmt":"2013-08-13T22:00:00","guid":{"rendered":"https:\/\/wwwneu.strehle.de\/tim\/weblog\/archives\/2013\/08\/14\/1638\/"},"modified":"2013-08-14T00:00:00","modified_gmt":"2013-08-13T22:00:00","slug":"1638","status":"publish","type":"post","link":"https:\/\/www.strehle.de\/tim\/weblog\/archives\/2013\/08\/14\/1638\/","title":{"rendered":"HTML Hypermedia API resources"},"content":{"rendered":"<p>One year ago, I <a href=\"https:\/\/twitter.com\/tistre\/status\/233466991715958784\">wrote on Twitter<\/a> that \u201cmy next API will be semantic XHTML\u201d. Since then, I\u2019ve been thinking a lot about Hypermedia APIs with HTML (and have done <a href=\"\/tim\/weblog\/archives\/2013\/06\/25\/1619\">some<\/a> <a href=\"\/tim\/zeit_api\/product.php\">prototyping<\/a>). My dream API would use XHTML with RDFa, link to Atom feeds and offer an alternative JSON-LD representation.<\/p>\n<p>Here\u2019s a few articles on that topic that made me think:<\/p>\n<p>It all started for me with <a href=\"http:\/\/codeartisan.blogspot.de\/2012\/07\/using-html-as-media-type-for-your-api.html\">Using HTML as the Media Type for your API<\/a> by Jon Moore. Make sure to read this. And the <a href=\"https:\/\/twitter.com\/stilkov\/status\/309302610324779008\">\u201cugly website\u201d Rickard \u00d6berg quote<\/a> tweeted by Stefan Tilkov.<\/p>\n<p><a href=\"http:\/\/www.jayway.com\/2012\/08\/01\/combining-html-hypermedia-apis-and-adaptive-web-design\/\">Combining HTML Hypermedia APIs and Adaptive Web Design<\/a> by Gustaf Nilsson Kotte is also a great read.<\/p>\n<p>Then watch the full talk (53 minutes) by Jon Moore on <a href=\"http:\/\/www.infoq.com\/presentations\/web-api-html\">Building Hypermedia APIs with HTML<\/a>.<\/p>\n<p>If you\u2019ve got some time left, I highly recommend the <a href=\"http:\/\/www.restfulwebservices.com\/REST\/restful-web-services-by-leonard-richardson-sam-ruby\/\">RESTful Web Services book<\/a> by Leonard Richardson and Sam Ruby. It already said this, back in 2007: \u201cIt might seem a little odd to use XHTML [\u2026] as a representation format for a web service. I chose it [\u2026] because HTML solves many general markup problems and you\u2019re probably already familiar with it. [\u2026] Though it\u2019s human-readable and easy to render attractively, nothing prevents well-formed HTML from being processed automatically like XML.\u201d (By the way, the follow-up <a href=\"http:\/\/shop.oreilly.com\/product\/0636920028468.do\">RESTful Web APIs<\/a> is going to be published next month.)<\/p>\n<p>I haven\u2019t read the book <a href=\"http:\/\/shop.oreilly.com\/product\/0636920020530.do\">Building Hypermedia APIs with HTML5 and Node<\/a> by Mike Amundsen yet, but it sounds interesting.<\/p>\n<p>Please let me know if I missed out on something important\u2026<\/p>\n<p><em>Update (2017-12-01):<\/em> See my follow-up post <a href=\"\/tim\/weblog\/archives\/2013\/08\/19\/1639\">Publish your data, don\u2019t build APIs<\/a>.<\/p>\n<p><em>Update (2018-05-31):<\/em> Jason Desrosiers \u2013 <a href=\"https:\/\/8thlight.com\/blog\/jason-desrosiers\/2018\/05\/30\/the-hypermedia-maturity-model.html\">The Hypermedia Maturity Model<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One year ago, I wrote on Twitter that \u201cmy next API will be semantic XHTML\u201d. Since then, I\u2019ve been thinking a lot about Hypermedia APIs with HTML (and have done some prototyping). My dream API would use XHTML with RDFa, link to Atom feeds and offer an alternative JSON-LD representation. Here\u2019s a few articles on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_share_on_mastodon":"0"},"categories":[1],"tags":[],"class_list":["post-1684","post","type-post","status-publish","format-standard","hentry","category-weblog"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/posts\/1684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/comments?post=1684"}],"version-history":[{"count":0,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/posts\/1684\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/media?parent=1684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/categories?post=1684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strehle.de\/tim\/wp-json\/wp\/v2\/tags?post=1684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}