{"_id":"56e64d5aec3f760e00105fcc","parentDoc":null,"user":"56e62c36cfa58f0e00eafcfb","version":{"_id":"56e29a8dd3b68d0e00b48ffd","hasReference":true,"project":"56e29a8dd3b68d0e00b48ffa","__v":15,"hasDoc":true,"createdAt":"2016-03-11T10:14:37.460Z","releaseDate":"2016-03-11T10:14:37.460Z","categories":["56e29a8ed3b68d0e00b48ffe","56eb917a2e58011700afdfcc","56eb92252109011700f3ba5e","5704d4af849f721900f27835","57052a31473f900e004d5d54","5715222811537f19006aab2d","5715b57b810df00e00cc7832","5715baa9810df00e00cc7837","57180ed83a17770e009a7322","571810273a17770e009a7325","579b22d3f4ad7b190094b60e","584538ecba4f1c0f0096925e","586bb88e5602870f00ae7177","5a70407fb0a01400369583c5","5ace359e40606a0003eac1de"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"project":"56e29a8dd3b68d0e00b48ffa","__v":26,"category":{"_id":"56e29a8ed3b68d0e00b48ffe","pages":["56e29a8fd3b68d0e00b49000","56e635e0cfa58f0e00eafcfe","56e6482dba14ad0e0000f523","56e64c9fcfa58f0e00eafd13","56e64d5aec3f760e00105fcc","56e653bf0121c60e006e5e24","56e8fc98c88bf80e00f8bf2c","56e982bf8617502200f19c11","56e98680f3c3031900041bf6","56e98c69cbeede0e0006e56c","56eb8a7b1633510e00f884fa"],"project":"56e29a8dd3b68d0e00b48ffa","version":"56e29a8dd3b68d0e00b48ffd","__v":11,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-11T10:14:38.490Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-14T05:34:18.258Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Requests that return multiple items return up to 50 items per page. If there are more than 50 items, each results page includes pagination links to subsequent pages in both the [header](pagination#section-link-header) and the [JSON body](pagination#section-link-json). Following the provided `rel` links instead of constructing your own pagination URLs reduces errors and guarantees that each pagination request contains relevant content. \n\n##Link Header\n\nPagination information is included in the Link header according to [RFC 5988](http://tools.ietf.org/html/rfc5988).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Link: <https://api.armadill.io/v2.0/companies/name={name}&page=2>; rel=\\\"next\\\",\\n  <https://api.armadill.io/v2.0/companies?name={name}&?page=6>; rel=\\\"last\\\"\",\n      \"language\": \"javascript\",\n      \"name\": \"Headers\"\n    }\n  ]\n}\n[/block]\n##Link JSON\n\nPagination information is included in JSON body in the `pagination` key.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"pagination\\\": {\\n    \\\"next\\\": \\\"https://api.armadill.io/v2.0/companies?name={name}&page=2\\\",\\n    \\\"last\\\": \\\"https://api.armadill.io/v2.0/companies?name={name}&?page=6\\\"\\n}\",\n      \"language\": \"javascript\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\n## `rel` Values\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Rel\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`next`\",\n    \"0-1\": \"The link relation for the immediate next page of results.\",\n    \"1-0\": \"`previous`\",\n    \"2-0\": \"`first`\",\n    \"3-0\": \"`last`\",\n    \"1-1\": \"The link relation for the immediate previous page of results.\",\n    \"2-1\": \"The link relation for the first page of results.\",\n    \"3-1\": \"The link relation for the last page of results.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n##Additional headers\n\nThe number of results and the number of pages is included in the header.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"X-TotalCount: 300,\\nX-PerPage: 50\",\n      \"language\": \"json\",\n      \"name\": \"Headers\"\n    }\n  ]\n}\n[/block]\n##Additional JSON data\n\nThe number of results and the number of pages is included in the JSON body in the `pagination` key.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"pagination\\\": {\\n\\t \\\"totalCount\\\": 300,\\n   \\\"perPage\\\": 50 \\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n##Empty results\n\nWhen no results are returned from the search, an empty structure is returned.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"pagination\\\": {\\n\\t \\\"totalCount\\\": 0,\\n   \\\"perPage\\\": 0\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"pagination","type":"basic","title":"Pagination"}
Requests that return multiple items return up to 50 items per page. If there are more than 50 items, each results page includes pagination links to subsequent pages in both the [header](pagination#section-link-header) and the [JSON body](pagination#section-link-json). Following the provided `rel` links instead of constructing your own pagination URLs reduces errors and guarantees that each pagination request contains relevant content. ##Link Header Pagination information is included in the Link header according to [RFC 5988](http://tools.ietf.org/html/rfc5988). [block:code] { "codes": [ { "code": "Link: <https://api.armadill.io/v2.0/companies/name={name}&page=2>; rel=\"next\",\n <https://api.armadill.io/v2.0/companies?name={name}&?page=6>; rel=\"last\"", "language": "javascript", "name": "Headers" } ] } [/block] ##Link JSON Pagination information is included in JSON body in the `pagination` key. [block:code] { "codes": [ { "code": "\"pagination\": {\n \"next\": \"https://api.armadill.io/v2.0/companies?name={name}&page=2\",\n \"last\": \"https://api.armadill.io/v2.0/companies?name={name}&?page=6\"\n}", "language": "javascript", "name": "JSON" } ] } [/block] ## `rel` Values [block:parameters] { "data": { "h-0": "Rel", "h-1": "Description", "0-0": "`next`", "0-1": "The link relation for the immediate next page of results.", "1-0": "`previous`", "2-0": "`first`", "3-0": "`last`", "1-1": "The link relation for the immediate previous page of results.", "2-1": "The link relation for the first page of results.", "3-1": "The link relation for the last page of results." }, "cols": 2, "rows": 4 } [/block] ##Additional headers The number of results and the number of pages is included in the header. [block:code] { "codes": [ { "code": "X-TotalCount: 300,\nX-PerPage: 50", "language": "json", "name": "Headers" } ] } [/block] ##Additional JSON data The number of results and the number of pages is included in the JSON body in the `pagination` key. [block:code] { "codes": [ { "code": "\"pagination\": {\n\t \"totalCount\": 300,\n \"perPage\": 50 \n}", "language": "json" } ] } [/block] ##Empty results When no results are returned from the search, an empty structure is returned. [block:code] { "codes": [ { "code": "\"pagination\": {\n\t \"totalCount\": 0,\n \"perPage\": 0\n}", "language": "json" } ] } [/block]