{"_id":"5a0e5015c96bc7001288e551","project":"5508a8940f146f3500b031c9","version":{"_id":"5508a8950f146f3500b031cc","__v":4,"project":"5508a8940f146f3500b031c9","createdAt":"2015-03-17T22:20:05.001Z","releaseDate":"2015-03-17T22:20:05.001Z","categories":["5508a8950f146f3500b031cd","5a0e2e283bb0d9001c09e3e1","5a0e2f9844969800124f4d3a","5a0e2fdcc96bc7001288e17d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5508a8950f146f3500b031cd","version":"5508a8950f146f3500b031cc","__v":1,"pages":["5508a8960f146f3500b031cf"],"project":"5508a8940f146f3500b031c9","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-17T22:20:05.520Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"user":"5508a87b99a1832100bf9569","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-11-17T02:57:25.272Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"* 200 (OK) - request good!\n* 302 (Found) - the root `/`, redirects to `/heartbeat`, and `/docs` redirects to these documents\n* 400 (Bad request) - When you have a malformed request, fix it and try again\n* 404 (Not found) - When you request a route that does not exist, fix it and try again\n* 405 (Method not allowed) - When you use a prohibited HTTP method (we only allow `GET` and `HEAD`)\n* 500 (Internal server error) - Server got itself in trouble; get in touch with us. (in [Issues](https://github.com/ropensci/fishbaseapi/issues))\n\n## 400 responses will look something like\n\n```\nHTTP/1.1 400 Bad Request\nCache-Control: public, must-revalidate, max-age=60\nConnection: close\nContent-Length: 61\nContent-Type: application/json\nDate: Thu, 26 Feb 2015 23:27:57 GMT\nServer: nginx/1.7.9\nStatus: 400 Bad Request\nX-Content-Type-Options: nosniff\n\n{\n    \"error\": \"invalid request\",\n    \"message\": \"maximum limit is 5000\"\n}\n```\n\n## 404 responses will look something like\n\n```\nHTTP/1.1 404 Not Found\nCache-Control: public, must-revalidate, max-age=60\nConnection: close\nContent-Length: 27\nContent-Type: application/json\nDate: Thu, 26 Feb 2015 23:27:16 GMT\nServer: nginx/1.7.9\nStatus: 404 Not Found\nX-Cascade: pass\nX-Content-Type-Options: nosniff\n\n{\n    \"error\": \"route not found\"\n}\n```\n\n## 405 responses will look something like (with an empty body)\n\n```\nHTTP/1.1 405 Method Not Allowed\nAccess-Control-Allow-Methods: HEAD, GET\nAccess-Control-Allow-Origin: *\nCache-Control: public, must-revalidate, max-age=60\nConnection: close\nContent-Length: 0\nContent-Type: application/json; charset=utf8\nDate: Mon, 27 Jul 2015 20:48:27 GMT\nServer: nginx/1.9.3\nStatus: 405 Method Not Allowed\nX-Content-Type-Options: nosniff\n```\n\n## 500 responses will look something like\n\n```\nHTTP/1.1 500 Internal Server Error\nCache-Control: public, must-revalidate, max-age=60\nConnection: close\nContent-Length: 24\nContent-Type: application/json\nDate: Thu, 26 Feb 2015 23:19:57 GMT\nServer: nginx/1.7.9\nStatus: 500 Internal Server Error\nX-Content-Type-Options: nosniff\n\n{\n    \"error\": \"server error\"\n}\n```\n\nOccassionally you may get a MySQL error message in your `error` slot. Get in touch\nwith us if that happens as that shouldn't be happening, and we'll need to fix\nsomething on our end.","excerpt":"","slug":"response-codes","type":"basic","title":"Response Codes"}
* 200 (OK) - request good! * 302 (Found) - the root `/`, redirects to `/heartbeat`, and `/docs` redirects to these documents * 400 (Bad request) - When you have a malformed request, fix it and try again * 404 (Not found) - When you request a route that does not exist, fix it and try again * 405 (Method not allowed) - When you use a prohibited HTTP method (we only allow `GET` and `HEAD`) * 500 (Internal server error) - Server got itself in trouble; get in touch with us. (in [Issues](https://github.com/ropensci/fishbaseapi/issues)) ## 400 responses will look something like ``` HTTP/1.1 400 Bad Request Cache-Control: public, must-revalidate, max-age=60 Connection: close Content-Length: 61 Content-Type: application/json Date: Thu, 26 Feb 2015 23:27:57 GMT Server: nginx/1.7.9 Status: 400 Bad Request X-Content-Type-Options: nosniff { "error": "invalid request", "message": "maximum limit is 5000" } ``` ## 404 responses will look something like ``` HTTP/1.1 404 Not Found Cache-Control: public, must-revalidate, max-age=60 Connection: close Content-Length: 27 Content-Type: application/json Date: Thu, 26 Feb 2015 23:27:16 GMT Server: nginx/1.7.9 Status: 404 Not Found X-Cascade: pass X-Content-Type-Options: nosniff { "error": "route not found" } ``` ## 405 responses will look something like (with an empty body) ``` HTTP/1.1 405 Method Not Allowed Access-Control-Allow-Methods: HEAD, GET Access-Control-Allow-Origin: * Cache-Control: public, must-revalidate, max-age=60 Connection: close Content-Length: 0 Content-Type: application/json; charset=utf8 Date: Mon, 27 Jul 2015 20:48:27 GMT Server: nginx/1.9.3 Status: 405 Method Not Allowed X-Content-Type-Options: nosniff ``` ## 500 responses will look something like ``` HTTP/1.1 500 Internal Server Error Cache-Control: public, must-revalidate, max-age=60 Connection: close Content-Length: 24 Content-Type: application/json Date: Thu, 26 Feb 2015 23:19:57 GMT Server: nginx/1.7.9 Status: 500 Internal Server Error X-Content-Type-Options: nosniff { "error": "server error" } ``` Occassionally you may get a MySQL error message in your `error` slot. Get in touch with us if that happens as that shouldn't be happening, and we'll need to fix something on our end.