{"_id":"5951d51ee965180015dd1c21","project":"56f962d8d522d81700600280","version":{"_id":"56f962d8d522d81700600283","hasDoc":true,"__v":5,"hasReference":true,"project":"56f962d8d522d81700600280","createdAt":"2016-03-28T16:59:04.166Z","releaseDate":"2016-03-28T16:59:04.166Z","categories":["56f962d8d522d81700600284","5951d5489435c30015923d54","5951d6de50727a00155053c6","5951d99224e2f70015dec6c6","5951e40ef5c137001533814b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"56f962d8d522d81700600284","project":"56f962d8d522d81700600280","version":"56f962d8d522d81700600283","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-28T16:59:04.186Z","from_sync":false,"order":0,"slug":"documentation","title":"Getting Started"},"user":"57736a020a6d610e00dea1fd","githubsync":"","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-27T03:46:38.804Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"When something is wrong with a request, the API will respond with a non-200 status code.\n\nTo help you better understand the problem, where possible, the API overloads a number of different HTTP error codes. Additional information is provided by way of subcodes and cause strings, so your application logic has as much visibility as possible into what has gone wrong.\n\n **An invalid request**\nHere's an example response to a request with an invalid API key.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"success\\\": false,\\n    \\\"error\\\": {\\n        \\\"code\\\": \\\"ACCESS_DENIED\\\",\\n        \\\"message\\\": \\\"Access is denied.\\\",\\n        \\\"description\\\": null\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nFor a more detailed look at the various error subcodes, their meaning and parent HTTP status codes, check out list below, which will be frequently updated as the API's error handling evolves.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"errors.unknownError = {‘status’: 500, ‘code’: ‘UNKNOWN_ERROR’, ‘message’: ‘Unknown Error.‘};\\nerrors.badRequest = {‘status’: 200, ‘code’: ‘INVALID_REQUEST’, ‘message’: ‘The request is invalid.‘};\\nerrors.accessDenied = {‘status’: 401, ‘code’: ‘ACCESS_DENIED’, ‘message’: ‘Access is denied.‘};\\nerrors.methodNotFound = {‘status’: 404, ‘code’: ‘METHOD_NOT_FOUND’, ‘message’: ‘Method is not found.‘};\\nerrors.emailNotFound = {‘status’: 200, ‘code’: ‘EMAIL_NOT_FOUND’, ‘message’: ‘The email address does not exist.‘};\\nerrors.driverNotFound = {‘status’: 200, ‘code’: ‘DRIVER_NOT_FOUND’, ‘message’: ‘The driver Id does not exist.‘};\\nerrors.teamNotFound = {‘status’: 200, ‘code’: ‘TEAM_NOT_FOUND’, ‘message’: ‘The team Id does not exist.‘};\\nerrors.taskNotFound = {‘status’: 200, ‘code’: ‘TASK_NOT_FOUND’, ‘message’: ‘The task does not exist.‘};\\nerrors.connectToSelf = {‘status’: 200, ‘code’: ‘CONNECT_TO_SELF’, ‘message’: ‘Cannot connect to self.‘};\\nerrors.connectionExist = {‘status’: 200, ‘code’: ‘CONNECTION_EXIST’, ‘message’: ‘This org is already connected.‘};\\nerrors.connectionIdNotExist = {\\n    ‘status’: 200,\\n    ‘code’: ‘CONNECTION_ID_NOT_EXIST’,\\n    ‘message’: ‘The connection company Id does not exist’\\n};\\nerrors.requestExist = {\\n    ‘status’: 200,\\n    ‘code’: ‘REQUEST_EXIST’,\\n    ‘message’: ‘A connection request already exists for this email address.’\\n};\\nerrors.alreadyDispatcher = {\\n    ‘status’: 200,\\n    ‘code’: ‘ALREADY_DISPATCHER’,\\n    ‘message’: ‘This email address is associated with a dispatcher.’\\n};\\nerrors.alreadyDriver = {\\n    ‘status’: 200,\\n    ‘code’: ‘ALREADY_DRIVER’,\\n    ‘message’: ‘This email address is associated with a driver.’\\n};\\nerrors.hubNameExist = {\\n    ‘status’: 200,\\n    ‘code’: ‘HUB_NAME_EXIST’,\\n    ‘message’: ‘The hub name already in use.’\\n};\\nerrors.teamNameExist = {\\n    ‘status’: 200,\\n    ‘code’: ‘TEAM_NAME_EXIST’,\\n    ‘message’: ‘The team name already in use.’\\n};\\nerrors.awbExist = {‘status’: 200, ‘code’: ‘AWB_EXIST’, ‘message’: ‘Awb already exist.‘};\\nerrors.phoneNotExist = {‘status’: 200, ‘code’: ‘PHONE_NOT_EXIST’, ‘message’: ‘The phone number does not exist.‘};\\n\\nerrors.taskAlreadyAssignToMySelf = {\\n    ‘code’: ‘TASK_ALREADY_ASSIGN_TO_MYSELF’,\\n    ‘message’: ‘It is already assigned to the same driver.’\\n};\\n\\nerrors.taskAlreadyProcessed = {\\n    ‘code’: ‘TASK_ALREADY_PROCESSED’,\\n    ‘message’: ‘It is already processed.’\\n};\\n\\nerrors.taskAlreadyCompleted = {\\n    ‘code’: ‘TASK_ALREADY_COMPLETED’,\\n    ‘message’: ‘It is already completed.’\\n};\\n\\nerrors.invalidAWB = {\\n    ‘code’: ‘INVALID_AWB’,\\n    ‘message’: ‘AWB is invalid.’\\n};\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"errors","type":"basic","title":"Errors"}
When something is wrong with a request, the API will respond with a non-200 status code. To help you better understand the problem, where possible, the API overloads a number of different HTTP error codes. Additional information is provided by way of subcodes and cause strings, so your application logic has as much visibility as possible into what has gone wrong. **An invalid request** Here's an example response to a request with an invalid API key. [block:code] { "codes": [ { "code": "{\n \"success\": false,\n \"error\": {\n \"code\": \"ACCESS_DENIED\",\n \"message\": \"Access is denied.\",\n \"description\": null\n }\n}", "language": "json" } ] } [/block] For a more detailed look at the various error subcodes, their meaning and parent HTTP status codes, check out list below, which will be frequently updated as the API's error handling evolves. [block:code] { "codes": [ { "code": "errors.unknownError = {‘status’: 500, ‘code’: ‘UNKNOWN_ERROR’, ‘message’: ‘Unknown Error.‘};\nerrors.badRequest = {‘status’: 200, ‘code’: ‘INVALID_REQUEST’, ‘message’: ‘The request is invalid.‘};\nerrors.accessDenied = {‘status’: 401, ‘code’: ‘ACCESS_DENIED’, ‘message’: ‘Access is denied.‘};\nerrors.methodNotFound = {‘status’: 404, ‘code’: ‘METHOD_NOT_FOUND’, ‘message’: ‘Method is not found.‘};\nerrors.emailNotFound = {‘status’: 200, ‘code’: ‘EMAIL_NOT_FOUND’, ‘message’: ‘The email address does not exist.‘};\nerrors.driverNotFound = {‘status’: 200, ‘code’: ‘DRIVER_NOT_FOUND’, ‘message’: ‘The driver Id does not exist.‘};\nerrors.teamNotFound = {‘status’: 200, ‘code’: ‘TEAM_NOT_FOUND’, ‘message’: ‘The team Id does not exist.‘};\nerrors.taskNotFound = {‘status’: 200, ‘code’: ‘TASK_NOT_FOUND’, ‘message’: ‘The task does not exist.‘};\nerrors.connectToSelf = {‘status’: 200, ‘code’: ‘CONNECT_TO_SELF’, ‘message’: ‘Cannot connect to self.‘};\nerrors.connectionExist = {‘status’: 200, ‘code’: ‘CONNECTION_EXIST’, ‘message’: ‘This org is already connected.‘};\nerrors.connectionIdNotExist = {\n ‘status’: 200,\n ‘code’: ‘CONNECTION_ID_NOT_EXIST’,\n ‘message’: ‘The connection company Id does not exist’\n};\nerrors.requestExist = {\n ‘status’: 200,\n ‘code’: ‘REQUEST_EXIST’,\n ‘message’: ‘A connection request already exists for this email address.’\n};\nerrors.alreadyDispatcher = {\n ‘status’: 200,\n ‘code’: ‘ALREADY_DISPATCHER’,\n ‘message’: ‘This email address is associated with a dispatcher.’\n};\nerrors.alreadyDriver = {\n ‘status’: 200,\n ‘code’: ‘ALREADY_DRIVER’,\n ‘message’: ‘This email address is associated with a driver.’\n};\nerrors.hubNameExist = {\n ‘status’: 200,\n ‘code’: ‘HUB_NAME_EXIST’,\n ‘message’: ‘The hub name already in use.’\n};\nerrors.teamNameExist = {\n ‘status’: 200,\n ‘code’: ‘TEAM_NAME_EXIST’,\n ‘message’: ‘The team name already in use.’\n};\nerrors.awbExist = {‘status’: 200, ‘code’: ‘AWB_EXIST’, ‘message’: ‘Awb already exist.‘};\nerrors.phoneNotExist = {‘status’: 200, ‘code’: ‘PHONE_NOT_EXIST’, ‘message’: ‘The phone number does not exist.‘};\n\nerrors.taskAlreadyAssignToMySelf = {\n ‘code’: ‘TASK_ALREADY_ASSIGN_TO_MYSELF’,\n ‘message’: ‘It is already assigned to the same driver.’\n};\n\nerrors.taskAlreadyProcessed = {\n ‘code’: ‘TASK_ALREADY_PROCESSED’,\n ‘message’: ‘It is already processed.’\n};\n\nerrors.taskAlreadyCompleted = {\n ‘code’: ‘TASK_ALREADY_COMPLETED’,\n ‘message’: ‘It is already completed.’\n};\n\nerrors.invalidAWB = {\n ‘code’: ‘INVALID_AWB’,\n ‘message’: ‘AWB is invalid.’\n};", "language": "json" } ] } [/block]