{"info":{"_postman_id":"2057a728-e43c-4b90-a43f-52658b45c94e","name":"Simple Blog API","description":"<html><head></head><body><p>Feel free to review this documentation for this simple API.</p>\n<p>The blog is a small app hosted on Heroku, and is meant to be a nice testing ground for making a very simple front-end which consumes API data created via a different request.</p>\n<p>Here's an example of using this API with the the Javascript <code>fetch</code> object:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-js\">fetch('https://hp-sample-blog.herokuapp.com/posts', { method: 'GET' })\n  .then(async (response) =&gt; {\n    // inspect the response headers\n    const page = await response.headers.get('page');\n    const total = await response.headers.get('total');\n    const perPage = await response.headers.get('per-page');\n    // get the response body in JSON\n    const body = await response.json();\n    return { headers: { page, total, perPage }, body };\n  })\n  .then(data =&gt; console.log(data)) // Log the output\n  .catch(error =&gt; console.error(error));\n</code></pre>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"2582145","collectionId":"2057a728-e43c-4b90-a43f-52658b45c94e","publishedId":"TzCQbn5S","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-04-05T19:05:18.000Z"},"item":[{"name":"List Posts","id":"a797770e-a24e-4d7e-8dfd-a60671383c5f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://hp-sample-blog.herokuapp.com/posts","description":"<p>List all the posts on the website.</p>\n<p>This list is paginated, and by default returns a list of 25 posts. To change the number of posts per page, and to request a different page, you can pass some parameters:</p>\n<ul>\n<li><code>per_page</code>: Returns the number of posts you specify (like 25 or 100). Defaults to 25</li>\n<li><code>page</code>: Returns the given page of results (like <code>?page=2</code> or <code>?page=3</code>). Defaults to 1</li>\n</ul>\n<p>Using the page headers, you can determine whether pagination is necessary. There are a handful of HTTP headers in the response you may find useful:</p>\n<ul>\n<li><code>Page</code>: The current page being requested</li>\n<li><code>Total</code>: The total number of posts</li>\n<li><code>Per-Page</code>: The number of posts to be returned per page.</li>\n</ul>\n","urlObject":{"protocol":"https","path":["posts"],"host":["hp-sample-blog","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"ad1bbdbb-f9e5-41d7-859b-51bddd689c83","name":"List Posts","originalRequest":{"method":"GET","header":[],"url":"https://hp-sample-blog.herokuapp.com/posts"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"},{"key":"Per-Page","value":"25"},{"key":"Page","value":"1"},{"key":"Total","value":"1"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Accept"},{"key":"ETag","value":"W/\"ca653219d88be7a3cc87ccc532049532\""},{"key":"Cache-Control","value":"max-age=0, private, must-revalidate"},{"key":"X-Request-Id","value":"e841759f-525d-431e-aace-47ae9ce32971"},{"key":"X-Runtime","value":"0.015041"},{"key":"Transfer-Encoding","value":"chunked"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 1,\n        \"title\": \"How not to write a blog post\",\n        \"description\": \"This is an awesome description\",\n        \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n        \"content_markdown\": \"**Some bold**\\n More content and stuff\",\n        \"content_html\": \"<p><strong>Some bold</strong>\\nMore content and stuff</p>\\n\",\n        \"created_at\": \"2021-04-05T18:12:39.762Z\",\n        \"updated_at\": \"2021-04-05T18:28:17.624Z\",\n        \"url\": \"http://localhost:3000/posts/1.json\"\n    }\n]"}],"_postman_id":"a797770e-a24e-4d7e-8dfd-a60671383c5f"},{"name":"Update a Post","id":"2eb7f740-cfee-498c-9fae-3cb12092e206","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"How not to write a blog post\",\n    \"description\": \"This is an awesome description\",\n    \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n    \"content_markdown\": \"## Some bold\\n\\n More content and stuff\"\n}","options":{"raw":{"language":"json"}}},"url":"https://hp-sample-blog.herokuapp.com/posts/1","description":"<p>Creates a single blog post</p>\n","urlObject":{"protocol":"https","path":["posts","1"],"host":["hp-sample-blog","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"103c7cbd-aa04-4b1a-9ecc-14809d4fd37d","name":"Update a Post","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"How not to write a blog post\",\n    \"description\": \"This is an awesome description\",\n    \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n    \"content_markdown\": \"## Some bold\\n\\n More content and stuff\"\n}","options":{"raw":{"language":"json"}}},"url":"https://hp-sample-blog.herokuapp.com/posts/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"},{"key":"Location","value":"http://localhost:3000/posts/1"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Accept"},{"key":"ETag","value":"W/\"254fdce09f22c304e246f29114ea654f\""},{"key":"Cache-Control","value":"max-age=0, private, must-revalidate"},{"key":"X-Request-Id","value":"b2c4be6f-d261-4bfe-8253-dfef74a239c0"},{"key":"X-Runtime","value":"0.009546"},{"key":"Transfer-Encoding","value":"chunked"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"title\": \"How not to write a blog post\",\n    \"description\": \"This is an awesome description\",\n    \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n    \"content_markdown\": \"## Some bold\\n\\n More content and stuff\",\n    \"content_html\": \"<h2>Some bold</h2>\\n<p>More content and stuff</p>\\n\",\n    \"created_at\": \"2021-04-05T18:12:39.762Z\",\n    \"updated_at\": \"2021-04-05T18:40:39.075Z\",\n    \"url\": \"http://localhost:3000/posts/1.json\"\n}"}],"_postman_id":"2eb7f740-cfee-498c-9fae-3cb12092e206"},{"name":"Create a post","id":"08a3671b-f503-4569-8def-20af0a8381c7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"A quick example blog post\",\n    \"description\": \"This is an awesome description\",\n    \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n    \"content_markdown\": \"## Some bold\\n\\n More content and stuff\"\n}","options":{"raw":{"language":"json"}}},"url":"https://hp-sample-blog.herokuapp.com/posts","description":"<p>Creates a single blog post</p>\n","urlObject":{"protocol":"https","path":["posts"],"host":["hp-sample-blog","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"23237d1c-1d69-46dd-a805-7d5ba195f8f6","name":"Create a Post","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n    \"title\": \"How not to write a blog post\",\n    \"description\": \"This is an awesome description\",\n    \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n    \"content_markdown\": \"## Some bold\\n\\n More content and stuff\"\n}","options":{"raw":{"language":"json"}}},"url":"https://hp-sample-blog.herokuapp.com/posts"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"},{"key":"Location","value":"http://localhost:3000/posts/1"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Vary","value":"Accept"},{"key":"ETag","value":"W/\"254fdce09f22c304e246f29114ea654f\""},{"key":"Cache-Control","value":"max-age=0, private, must-revalidate"},{"key":"X-Request-Id","value":"b2c4be6f-d261-4bfe-8253-dfef74a239c0"},{"key":"X-Runtime","value":"0.009546"},{"key":"Transfer-Encoding","value":"chunked"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"title\": \"How not to write a blog post\",\n    \"description\": \"This is an awesome description\",\n    \"image_url\": \"https://images.unsplash.com/photo-1592136187769-65d502332dc6\",\n    \"content_markdown\": \"## Some bold\\n\\n More content and stuff\",\n    \"content_html\": \"<h2>Some bold</h2>\\n<p>More content and stuff</p>\\n\",\n    \"created_at\": \"2021-04-05T18:12:39.762Z\",\n    \"updated_at\": \"2021-04-05T18:40:39.075Z\",\n    \"url\": \"http://localhost:3000/posts/1.json\"\n}"}],"_postman_id":"08a3671b-f503-4569-8def-20af0a8381c7"},{"name":"Delete a Post","id":"a85c9488-5821-480a-9611-704514f7ce45","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://hp-sample-blog.herokuapp.com/posts/1","description":"<p>Deletes a single post</p>\n","urlObject":{"protocol":"https","path":["posts","1"],"host":["hp-sample-blog","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"6f763d9f-b799-455d-8463-9835411c422c","name":"Delete a Post","originalRequest":{"method":"DELETE","header":[],"url":"https://hp-sample-blog.herokuapp.com/posts/1"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"X-Frame-Options","value":"SAMEORIGIN"},{"key":"X-XSS-Protection","value":"1; mode=block"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"X-Download-Options","value":"noopen"},{"key":"X-Permitted-Cross-Domain-Policies","value":"none"},{"key":"Referrer-Policy","value":"strict-origin-when-cross-origin"},{"key":"Cache-Control","value":"no-cache"},{"key":"X-Request-Id","value":"4fbf89a4-76cb-4006-80af-f971e1678668"},{"key":"X-Runtime","value":"0.029172"}],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"a85c9488-5821-480a-9611-704514f7ce45"}],"event":[{"listen":"prerequest","script":{"id":"6532c07c-a678-4f33-9ba1-7b8bd01e199b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"3fd04180-b8d3-45e8-bc10-3f4a81e4e105","type":"text/javascript","exec":[""]}}],"variable":[{"key":"id","value":"1"}]}