{"__v":6,"_id":"55a58eac0f354f0d00fd0324","category":{"project":"559a61d2dbcfd20d00710b39","version":"559a61d2dbcfd20d00710b3c","_id":"55afb260902fd51700f5f8c2","pages":[],"__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-07-22T15:10:24.728Z","from_sync":false,"order":5,"slug":"rest-api-1","title":"REST API"},"parentDoc":null,"project":"559a61d2dbcfd20d00710b39","user":"55a575ebaaf9cf1900114d73","version":{"__v":23,"_id":"559a61d2dbcfd20d00710b3c","project":"559a61d2dbcfd20d00710b39","createdAt":"2015-07-06T11:09:06.510Z","releaseDate":"2015-07-06T11:09:06.510Z","categories":["559a61d3dbcfd20d00710b3d","55a589ddaaf9cf1900114dd0","55a589e30f354f0d00fd0312","55a589ea80c8a30d00b323cc","55a589f6aaf9cf1900114dd1","55a58d4e80c8a30d00b323e6","55a8e7a227a17d21005251a2","55a93098cf45e1390093f351","55afb085f202b12100cd9e83","55afb22e902fd51700f5f8bf","55afb260902fd51700f5f8c2","55afb28ec8a85321007a5462","55afb294f202b12100cd9e95","55afb29b902fd51700f5f8c5","55afb2a1c8a85321007a5463","55afb2a7902fd51700f5f8c7","55afb2ad902fd51700f5f8c8","55afb2b5902fd51700f5f8ca","55b74b2131bccb190081bedc","55bb441b54f9640d006e6cf2","565711085cb2420d00d70071","5681681330018c0d006bf7ff","588f38b5923d610f00c72dad"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-14T22:35:24.198Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Name\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"200\",\n    \"0-1\": \"OK\",\n    \"0-2\": \"Everything worked successfully!\",\n    \"1-0\": \"201\",\n    \"1-1\": \"Created\",\n    \"1-2\": \"When you're creating a new object, this will be returned upon success.\",\n    \"2-0\": \"400\",\n    \"2-1\": \"Bad Request\",\n    \"2-2\": \"We could not process the action due to client error.\",\n    \"3-0\": \"403\",\n    \"3-1\": \"Forbidden\",\n    \"3-2\": \"We couldn't authenticate you, or you don't have access to that resource.\",\n    \"4-0\": \"404\",\n    \"4-1\": \"Not Found\",\n    \"4-2\": \"The requested resource could not be found.\",\n    \"5-0\": \"408\",\n    \"5-1\": \"Request Timeout\",\n    \"5-2\": \"The server timed out waiting for the request. The client may repeat the request without modifications at any later time.\",\n    \"7-0\": \"415\",\n    \"7-1\": \"Unsupported Media Type\",\n    \"7-2\": \"The request entity has a media type which the server or resource does not support.\",\n    \"8-0\": \"500\",\n    \"8-1\": \"Internal Server Error\",\n    \"8-2\": \"Ooops! Something went wrong in MOCA Backend. The team will look into it.\",\n    \"9-0\": \"503\",\n    \"9-1\": \"Service Unavailable\",\n    \"9-2\": \"The service is currently unavailable because it is overloaded or down for maintenance.\",\n    \"6-0\": \"409\",\n    \"6-1\": \"Conflict\",\n    \"6-2\": \"The request could not be processed because of a conflict in the request.\"\n  },\n  \"cols\": 3,\n  \"rows\": 10\n}\n[/block]\nOur API libraries can raise exceptions for many reasons, such as a failed charge, invalid parameters, authentication errors, and network unavailability. We recommend always trying to gracefully handle exceptions from our API.","excerpt":"The following is a list of response status code MOCA REST API may return.","slug":"moca-rest-api-error-handling","type":"basic","title":"Error Handling"}

Error Handling

The following is a list of response status code MOCA REST API may return.

[block:parameters] { "data": { "h-0": "Code", "h-1": "Name", "h-2": "Description", "0-0": "200", "0-1": "OK", "0-2": "Everything worked successfully!", "1-0": "201", "1-1": "Created", "1-2": "When you're creating a new object, this will be returned upon success.", "2-0": "400", "2-1": "Bad Request", "2-2": "We could not process the action due to client error.", "3-0": "403", "3-1": "Forbidden", "3-2": "We couldn't authenticate you, or you don't have access to that resource.", "4-0": "404", "4-1": "Not Found", "4-2": "The requested resource could not be found.", "5-0": "408", "5-1": "Request Timeout", "5-2": "The server timed out waiting for the request. The client may repeat the request without modifications at any later time.", "7-0": "415", "7-1": "Unsupported Media Type", "7-2": "The request entity has a media type which the server or resource does not support.", "8-0": "500", "8-1": "Internal Server Error", "8-2": "Ooops! Something went wrong in MOCA Backend. The team will look into it.", "9-0": "503", "9-1": "Service Unavailable", "9-2": "The service is currently unavailable because it is overloaded or down for maintenance.", "6-0": "409", "6-1": "Conflict", "6-2": "The request could not be processed because of a conflict in the request." }, "cols": 3, "rows": 10 } [/block] Our API libraries can raise exceptions for many reasons, such as a failed charge, invalid parameters, authentication errors, and network unavailability. We recommend always trying to gracefully handle exceptions from our API.