{"_id":"55fdae0f51dbf70d00c61bb8","project":"556cd8aec14029190092d292","category":{"_id":"556cd8afc14029190092d296","pages":["556cd8b0c14029190092d298","55fc80353c21291900e7e0b0","55fc86873c21291900e7e0bd","55fc87be4ee5911900d357a9","55fdacf3b652110d00758b68","55fdae0f51dbf70d00c61bb8","55fdaf4156d6990d00a6cac5","560efa0743ea130d00a3621a","56169ba4a6767c0d00166a46","56aa75e24350eb17009147b5"],"__v":10,"project":"556cd8aec14029190092d292","version":"556cd8aec14029190092d295","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-01T22:11:59.312Z","from_sync":false,"order":1,"slug":"about-the-api","title":"About The API"},"version":{"_id":"556cd8aec14029190092d295","__v":14,"project":"556cd8aec14029190092d292","createdAt":"2015-06-01T22:11:58.756Z","releaseDate":"2015-06-01T22:11:58.756Z","categories":["556cd8afc14029190092d296","55ca5a55241e790d004f47ea","55dc9fdb4f535537007da1b2","55dc9fdfc755b63700dc843c","55fdb08c4bebdf17004130d4","560ef4c2a36c610d00e7013e","5613db296a092921004c30c2","56156581dc8aea0d002475e8","56169d1ee98f5517005627a8","5622fde7de7dc01700c6dd5f","56cf75f3336aa60b0086a495","5818f3c02093901b00bcf91a","582f7ff88ea0800f0035639a","583f30c110448a2500dd990f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"user":"556cbb50c14029190092d20f","__v":6,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-09-19T18:48:47.810Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"The API will use standard HTTP response codes where appropriate. That means that any 2xx code should be considered successful, 3xx a redirect, 4xx a validation or client-recoverable failure, and 5xx a server-side failure that may be temporary. \n\nIn the case of missing parameters, a 412 code with a message key is shown, mapped to a text message.\n\nFor POST requests, the 412 error code will be returned for validation errors with a field by field breakdown. If the errors element is present, it will be a json hash of fields to messages. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"message\\\": \\\"This is the human readable summary of problems\\\",\\n  \\\"errors\\\": {\\n    \\\"password\\\": [\\n      \\\"is too short (minimum is 5 characters)\\\"\\n    ]\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Code clients to classes of statuses (2xx), not to specific status codes (200)\",\n  \"body\": \"If your client is handling errors, ensure that any 2xx response is considered successful,  any 4xx response is considered a client correctable error, any 5xx response is considered a temporary server failure. Do not hardcode \\\"200\\\", \\\"400\\\", \\\"500\\\", etc as these codes may change.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Common Response Codes\"\n}\n[/block]\nHere's a table of common response codes. Generally, codes mean what they mean in the [HTTP 1.1 RFC](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), so please refer there for any additional information.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Meaning\",\n    \"0-0\": \"200\",\n    \"0-1\": \"Resource was updated or created.\",\n    \"1-0\": \"201\",\n    \"1-1\": \"Resource was created.\",\n    \"2-0\": \"202\",\n    \"2-1\": \"Resource update is in progress. This likely means the update is asynchronous and may take some time to complete.\",\n    \"6-0\": \"404\",\n    \"6-1\": \"Resource not found.\",\n    \"7-0\": \"406\",\n    \"7-1\": \"Could not complete request because it would violate some constraint. Example: can't delete listings that are not drafts.\",\n    \"8-0\": \"429\",\n    \"8-1\": \"Rate limiting. Indicates that you should wait and try again in a while.\",\n    \"5-0\": \"401\",\n    \"5-1\": \"Unauthorized. Please log in and obtain a new authorization token.\",\n    \"3-0\": \"304\",\n    \"3-1\": \"Resource not modified. For clients that are compatible with ETags, indicates that the client should fetch the latest version of the resource from its cache. The server response will be empty.\",\n    \"4-0\": \"400\",\n    \"4-1\": \"Parameters are missing or invalid.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","excerpt":"Common error codes and meanings.","slug":"error-handling","type":"basic","title":"Error Handling"}

Error Handling

Common error codes and meanings.

The API will use standard HTTP response codes where appropriate. That means that any 2xx code should be considered successful, 3xx a redirect, 4xx a validation or client-recoverable failure, and 5xx a server-side failure that may be temporary. In the case of missing parameters, a 412 code with a message key is shown, mapped to a text message. For POST requests, the 412 error code will be returned for validation errors with a field by field breakdown. If the errors element is present, it will be a json hash of fields to messages. [block:code] { "codes": [ { "code": "{\n \"message\": \"This is the human readable summary of problems\",\n \"errors\": {\n \"password\": [\n \"is too short (minimum is 5 characters)\"\n ]\n }\n}", "language": "json" } ] } [/block] [block:callout] { "type": "danger", "title": "Code clients to classes of statuses (2xx), not to specific status codes (200)", "body": "If your client is handling errors, ensure that any 2xx response is considered successful, any 4xx response is considered a client correctable error, any 5xx response is considered a temporary server failure. Do not hardcode \"200\", \"400\", \"500\", etc as these codes may change." } [/block] [block:api-header] { "type": "basic", "title": "Common Response Codes" } [/block] Here's a table of common response codes. Generally, codes mean what they mean in the [HTTP 1.1 RFC](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html), so please refer there for any additional information. [block:parameters] { "data": { "h-0": "Code", "h-1": "Meaning", "0-0": "200", "0-1": "Resource was updated or created.", "1-0": "201", "1-1": "Resource was created.", "2-0": "202", "2-1": "Resource update is in progress. This likely means the update is asynchronous and may take some time to complete.", "6-0": "404", "6-1": "Resource not found.", "7-0": "406", "7-1": "Could not complete request because it would violate some constraint. Example: can't delete listings that are not drafts.", "8-0": "429", "8-1": "Rate limiting. Indicates that you should wait and try again in a while.", "5-0": "401", "5-1": "Unauthorized. Please log in and obtain a new authorization token.", "3-0": "304", "3-1": "Resource not modified. For clients that are compatible with ETags, indicates that the client should fetch the latest version of the resource from its cache. The server response will be empty.", "4-0": "400", "4-1": "Parameters are missing or invalid." }, "cols": 2, "rows": 9 } [/block]