{"__v":2,"_id":"5624b29806e8040d005ed6a0","category":{"__v":7,"_id":"5624bbb785a31117001c5403","pages":["5653264657978b1700df716a","5655bcf8dd82540d00278c26","5655bfd81a06b61900c66873","5655c7c0a66be71700968dd7","5660588e4320a80d00bec124","56618ad455e4450d00e62b89","56f1685a2a85600e00ea3dca"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-10-19T09:45:27.364Z","from_sync":false,"order":8,"slug":"2-factor-authentication","title":"2-factor authentication"},"parentDoc":null,"project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","version":{"__v":18,"_id":"54eb63b859b1172100334fae","forked_from":"54eb63a1867e1917009b711d","project":"54eb50e5615ffc1900305a16","createdAt":"2015-02-23T17:30:32.501Z","releaseDate":"2015-02-23T17:30:32.501Z","categories":["54eb63b959b1172100334faf","54eb63b959b1172100334fb0","54eb63b959b1172100334fb1","54eb63b959b1172100334fb2","54ed8dd4ab373e2300f50eae","54ed99b2ab373e2300f50ede","55153a6de68daa2f00cff838","551546edbc466623002afe72","5515472ac28d6125001b8884","55154749c28d6125001b8885","555d9b4106dfec0d00d38ea7","5613e06e433e5735007c7708","5624bbb785a31117001c5403","56669e857cc81e0d00253f8e","568b8d837a42220d00498311","56a632277ef6620d00e2f18a","56d8147c3eb4dd0b00201aac","57a9ce2fac6db30e000d7efd","57a9cf4e944ea60e00dc3f74","58172386715dce0f00da4aa0","582dc59ee1b8692300c0dd03"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-10-19T09:06:32.298Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":16,"body":"## Response Status Codes\n\n|Status Code|Description|\n|:---|:---|\n|200|**OK** - The request has succeeded. The client can read the result of the request in the body and the headers of the response.|\n|400|**Bad Request** - The request could not be understood by the server due to malformed syntax or invalid argument. |\n|401|**Unauthorized** - The request requires user authentication or, if the request included authorization credentials, authorization has been refused for those credentials.|\n|404|**Not Found** - The requested resource could not be found. This error can be due to a temporary or permanent condition.|\n|429|**Too Many Requests** - Rate limiting has been applied.|\n|500|**Internal Server Error**.|\n|503|**Service Unavailable** - The server is currently unable to handle the request due to a temporary condition which will be alleviated after some delay. You can choose to resend the request again. |\n\n## Error Details\n\nApart from the response code, unsuccessful responses return information about the error as an error JSON object:\n\n### Error object\n\n|Parameter|Type|Description|\n|---|---|---|\n|*messageId*|String|ID of an error|\n|*text*|String|A short description of the error.|\n\n### Error example\n\nHere, as an example, is the error that occurs when trying to send PIN with non-existent message:\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /2fa/1/pin HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9\\nContent-Type: application/json\\n\\t\\n{\\n  \\\"applicationId\\\":\\\"E56D48F9FFA2B679C815F8AF33282A7C\\\",\\n  \\\"messageId\\\":\\\"CA71036B771AEC408772F93BC855D00A\\\",\\n  \\\"to\\\":\\\"385985555555\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"requestError\\\": {\\n       \\\"serviceException\\\": {\\n           \\\"messageId\\\": \\\"RESOURCE_NOT_FOUND\\\",\\n           \\\"text\\\": \\\"Application or message with given ID cannot be found.\\\"\\n       }\\n   }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"2fa-status-codes-and-error-details","type":"basic","title":"2FA status codes and error details"}

2FA status codes and error details


## Response Status Codes |Status Code|Description| |:---|:---| |200|**OK** - The request has succeeded. The client can read the result of the request in the body and the headers of the response.| |400|**Bad Request** - The request could not be understood by the server due to malformed syntax or invalid argument. | |401|**Unauthorized** - The request requires user authentication or, if the request included authorization credentials, authorization has been refused for those credentials.| |404|**Not Found** - The requested resource could not be found. This error can be due to a temporary or permanent condition.| |429|**Too Many Requests** - Rate limiting has been applied.| |500|**Internal Server Error**.| |503|**Service Unavailable** - The server is currently unable to handle the request due to a temporary condition which will be alleviated after some delay. You can choose to resend the request again. | ## Error Details Apart from the response code, unsuccessful responses return information about the error as an error JSON object: ### Error object |Parameter|Type|Description| |---|---|---| |*messageId*|String|ID of an error| |*text*|String|A short description of the error.| ### Error example Here, as an example, is the error that occurs when trying to send PIN with non-existent message: **Request** [block:code] { "codes": [ { "code": "POST /2fa/1/pin HTTP/1.1\nHost: api.infobip.com\nAuthorization: App 003026bbc133714df1834b8638bb496e-8f4b3d9a-e931-478d-a994-28a725159ab9\nContent-Type: application/json\n\t\n{\n \"applicationId\":\"E56D48F9FFA2B679C815F8AF33282A7C\",\n \"messageId\":\"CA71036B771AEC408772F93BC855D00A\",\n \"to\":\"385985555555\"\n}", "language": "json" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"RESOURCE_NOT_FOUND\",\n \"text\": \"Application or message with given ID cannot be found.\"\n }\n }\n}", "language": "json" } ] } [/block]