{"_id":"59bbe55615d1e10024261bae","project":"54eb50e5615ffc1900305a16","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":28,"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","589b19b4fec2730f0082e040","58b04a023529383900a759b5","58b92d1598157a0f004869bf","592e7685c58275000f20174f","59392839e376d4002f8a0474","59393064e376d4002f8a05a1","5947ae0d4005e2000f3a4fec","594a74df1d1de5001ab3517a","5954bc387a147f001b918915","59b8eeeb707542001076d3b6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"category":{"_id":"5624bbb785a31117001c5403","pages":["5653264657978b1700df716a","5655bcf8dd82540d00278c26","5655bfd81a06b61900c66873","5655c7c0a66be71700968dd7","5660588e4320a80d00bec124","56618ad455e4450d00e62b89","56f1685a2a85600e00ea3dca"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","__v":7,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-10-19T09:45:27.364Z","from_sync":false,"order":11,"slug":"2-factor-authentication","title":"2-factor authentication"},"user":"599aeb1fe2b015002378a17b","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-09-15T14:36:06.374Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":16,"body":"The application represents your service. It's a good practice to have separate applications for separate services. You may also have separate applications for the same service but different use cases. For example, 2FA for login may be represented as one application and 2FA for changing password as another. Separating use cases in different applications will allow you to choose different options and behavior for for each use case (like PIN attempts or PIN limits).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Creating application is the first step of the 2FA setup process. See [2FA Introduction](/docs/2fa-introduction-and-setup) to learn about next steps.\"\n}\n[/block]\nOn this page you will find how to:\n\n* [Create new application](#section-resource)\n* [List all applications](#list-all-applications)\n* [Get application by ID](#get-application-by-id)\n* [Update application](#update-application)\n\n##Resource\n```\nhttps://api.infobip.com/2fa/2/applications\n```\n##Resource description\n\n|Parameter|Type|Description|\n|-|-|-|\n|*name* *|string|2FA application name|\n|*enabled*|boolean|Indicates if the created application is enabled.|\n|*configuration*|object|Created 2FA application configuration.|\n|> *pinAttempts*|integer|Number of possible PIN attempts.<br>Default value: `10`|\n|> *pinTimeToLive*|string|PIN time to live.<br>Default value: `15m`  ([Time format](#section-time-format))|\n|> *verifyPinLimit*|string|Number of PIN verification requests in time interval from one phone number (MSISDN). <br>Default value: `1/3s` ([Limit format](#section-limit-format))|\n|> *sendPinPerApplicationLimit*|string|Overall number of requests in time interval for generating a PIN and sending an SMS using single application.<br>Default value: `10000/1d` ([Limit format](#section-limit-format))|\n|> *sendPinPerPhoneNumberLimit*|string|Number of requests in time interval for generating a PIN and sending an SMS to one phone number (MSISDN).<br>Default value: `3/1d` ([Limit format](#section-limit-format))|\n|> *allowMultiplePinVerifications*|boolean|Default value: true. Tells if multiple PIN verification are allowed.|\n|*applicationId*|string|2FA application ID.|\n|*name*|string|2FA application name.|\n|*enabled*|boolean|Indicates if the created application is enabled.|\n|*processId*|string|Process tracking ID. You can track conversion rate across 2FA process using multiple parameters.|\n\n\n###Time format\n  * Format: {timeLength}{timeUnit}\n  * timeLength: positive integer\n  * timeUnit: milliseconds `ms`, seconds `s`, minutes `m`, hours `h`,  days `d`\n  * Examples: `15m`, `1h`, `2d`\n\n###Limit format\n * Format: {attempts}/{timeLength}{timeUnit}\n * attempts: positive integer\n * timeLength: positive integer\n * timeUnit: milliseconds `ms`, seconds `s`, minutes `m`, hours `h`,  days `d`\n * Examples: `10/15m`, `2/10s`\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Create new application\"\n}\n[/block]\nUse this method to create a new application.\n```\nPOST https://api.infobip.com/2fa/2/applications\n```\n\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /2fa/2/applications HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"name\\\":\\\"Test application BASIC\\\",\\n\\t\\\"configuration\\\": {\\n\\t    \\\"pinAttempts\\\": 10,\\n\\t    \\\"allowMultiplePinVerifications\\\": true,\\n\\t    \\\"pinTimeToLive\\\": \\\"15m\\\",\\n\\t    \\\"verifyPinLimit\\\": \\\"1/3s\\\",\\n\\t    \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n\\t    \\\"sendPinPerPhoneNumberLimit\\\": \\\"3/1d\\\"\\n\\t},\\n\\t\\\"enabled\\\": true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    },\n    {\n      \"code\": \"POST /2fa/2/applications HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"configuration\\\": {\\n\\t    \\\"pinAttempts\\\": 10\\n\\t}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Name parameter missing\"\n    },\n    {\n      \"code\": \"POST /2fa/2/applications HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"name\\\":\\\"Test application BASIC\\\",\\n\\t\\\"configuration\\\": {\\n\\t    \\\"sendPinPerApplicationLimit\\\": \\\"10000/WRONG_LIMIT_FORMAT\\\"\\n\\t}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect limit format\"\n    },\n    {\n      \"code\": \"POST /2fa/2/applications HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"name\\\":\\\"Test application BASIC\\\",\\n\\t\\\"configuration\\\": {\\n\\t    \\\"pinTimeToLive\\\": \\\"WRONG_TIME_FORMAT\\\"\\n\\t}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect time format\"\n    }\n  ]\n}\n[/block]\nResponse:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"applicationId\\\": \\\"797493BB352B7B84588F108CEBAAE43E\\\",\\n    \\\"name\\\": \\\"Test application BASIC\\\",\\n    \\\"configuration\\\": {\\n        \\\"pinAttempts\\\": 10,\\n        \\\"allowMultiplePinVerifications\\\": true,\\n        \\\"pinTimeToLive\\\": \\\"15m\\\",\\n        \\\"verifyPinLimit\\\": \\\"1/3s\\\",\\n        \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n        \\\"sendPinPerPhoneNumberLimit\\\": \\\"3/1d\\\"\\n    },\\n    \\\"enabled\\\": true,\\n    \\\"processId\\\": \\\"7C07B00C815FE79426ABD09702F2352F\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"[name : may not be null]\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Name parameter missing\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"[configuration.sendPinPerApplicationLimit : Limit format should be \\\\\\\"{attempts}/{timeLength}{timeUnit}\\\\\\\". Time units can be: ms, s, m, h, d]\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect limit format\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"[configuration.pinTimeToLive : Time format should be \\\\\\\"{timeLength}{timeUnit}\\\\\\\". Time units can be: ms, s, m, h, d]\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect time format\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"List all applications\"\n}\n[/block]\nUse this method to get all 2FA applications for your account.\n```\nGET https://api.infobip.com/2fa/2/applications/\n```\n\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /2fa/2/applications HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    }\n  ]\n}\n[/block]\nResponse:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n    {\\n        \\\"applicationId\\\": \\\"0933F3BC087D2A617AC6DCB2EF5B8A61\\\",\\n        \\\"name\\\": \\\"Test application BASIC 1\\\",\\n        \\\"configuration\\\": {\\n            \\\"pinAttempts\\\": 10,\\n            \\\"allowMultiplePinVerifications\\\": true,\\n            \\\"pinTimeToLive\\\": \\\"2h\\\",\\n            \\\"verifyPinLimit\\\": \\\"1/3s\\\",\\n            \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n            \\\"sendPinPerPhoneNumberLimit\\\": \\\"3/1d\\\"\\n        },\\n        \\\"enabled\\\": true,\\n        \\\"processId\\\": \\\"B63B57356B996AF0E2EC669EDDD14980\\\"\\n    },\\n    {\\n        \\\"applicationId\\\": \\\"5F04FACFAA4978F62FCAEBA97B37E90F\\\",\\n        \\\"name\\\": \\\"Test application BASIC 2\\\",\\n        \\\"configuration\\\": {\\n            \\\"pinAttempts\\\": 12,\\n            \\\"allowMultiplePinVerifications\\\": true,\\n            \\\"pinTimeToLive\\\": \\\"10m\\\",\\n            \\\"verifyPinLimit\\\": \\\"2/1s\\\",\\n            \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n            \\\"sendPinPerPhoneNumberLimit\\\": \\\"5/1h\\\"\\n        },\\n        \\\"enabled\\\": true,\\n        \\\"processId\\\": \\\"281EE180A3260FA64C74A5134634D6E8\\\"\\n    },\\n    {\\n        \\\"applicationId\\\": \\\"B450F966A8EF017180F148AF22C42642\\\",\\n        \\\"name\\\": \\\"Test application BASIC 3\\\",\\n        \\\"configuration\\\": {\\n            \\\"pinAttempts\\\": 15,\\n            \\\"allowMultiplePinVerifications\\\": true,\\n            \\\"pinTimeToLive\\\": \\\"1h\\\",\\n            \\\"verifyPinLimit\\\": \\\"30/10s\\\",\\n            \\\"sendPinPerApplicationLimit\\\": \\\"10000/3d\\\",\\n            \\\"sendPinPerPhoneNumberLimit\\\": \\\"10/20m\\\"\\n        },\\n        \\\"enabled\\\": true,\\n        \\\"processId\\\": \\\"3E4900A3F32CC96B461DD221C6EF7BEC\\\"\\n    }\\n]\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Get single application\"\n}\n[/block]\nUse this method to get the specific 2FA application identified by `applicationId`\n```\nGET https://api.infobip.com/2fa/2/applications/{applicationId}\n```\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    },\n    {\n      \"code\": \"GET /2fa/2/applications/ID_DOESNT_EXIST HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n      \"language\": \"json\",\n      \"name\": \"ID doesn't exist\"\n    }\n  ]\n}\n[/block]\nResponse:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"applicationId\\\": \\\"0933F3BC087D2A617AC6DCB2EF5B8A61\\\",\\n    \\\"name\\\": \\\"Test application BASIC\\\",\\n    \\\"configuration\\\": {\\n        \\\"pinAttempts\\\": 10,\\n        \\\"allowMultiplePinVerifications\\\": true,\\n        \\\"pinTimeToLive\\\": \\\"2h\\\",\\n        \\\"verifyPinLimit\\\": \\\"1/3s\\\",\\n        \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n        \\\"sendPinPerPhoneNumberLimit\\\": \\\"3/1d\\\"\\n    },\\n    \\\"enabled\\\": true,\\n    \\\"processId\\\": \\\"B63B57356B996AF0E2EC669EDDD14980\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"Bad request\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"ID doesn't exist\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Update application\"\n}\n[/block]\nUse this method to update your 2FA application that is already created. Application is identified by `applicationId`\n```\nPUT https://api.infobip.com/2fa/2/applications/{applicationId}\n```\n###Request example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"name\\\":\\\"Test application BASIC\\\",\\n\\t\\\"configuration\\\": {\\n\\t    \\\"pinAttempts\\\": 10,\\n\\t    \\\"allowMultiplePinVerifications\\\": true,\\n\\t    \\\"pinTimeToLive\\\": \\\"120m\\\",\\n\\t    \\\"verifyPinLimit\\\": \\\"1/3s\\\",\\n\\t    \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n\\t    \\\"sendPinPerPhoneNumberLimit\\\": \\\"3/1d\\\"\\n\\t},\\n\\t\\\"enabled\\\": true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"JSON\"\n    },\n    {\n      \"code\": \"PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"configuration\\\": {\\n\\t    \\\"pinAttempts\\\": 10\\n\\t}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Name parameter missing\"\n    },\n    {\n      \"code\": \"PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"name\\\":\\\"Test application BASIC\\\",\\n\\t\\\"configuration\\\": {\\n\\t    \\\"sendPinPerPhoneNumberLimit\\\": \\\"WRONG_LIMIT_FORMAT/30m\\\"\\n\\t}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect limit format\"\n    },\n    {\n      \"code\": \"PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\\nHost: api.infobip.com\\nContent-Type: application/json\\nAccept: application/json\\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\n\\n{\\n\\t\\\"name\\\":\\\"Test application BASIC\\\",\\n\\t\\\"configuration\\\": {\\n\\t    \\\"pinTimeToLive\\\": \\\"WRONG_TIME_FORMAT\\\"\\n\\t}\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect time format\"\n    }\n  ]\n}\n[/block]\nResponse: \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"applicationId\\\": \\\"0933F3BC087D2A617AC6DCB2EF5B8A61\\\",\\n    \\\"name\\\": \\\"Test application BASIC\\\",\\n    \\\"configuration\\\": {\\n        \\\"pinAttempts\\\": 10,\\n        \\\"allowMultiplePinVerifications\\\": true,\\n        \\\"pinTimeToLive\\\": \\\"2h\\\",\\n        \\\"verifyPinLimit\\\": \\\"1/3s\\\",\\n        \\\"sendPinPerApplicationLimit\\\": \\\"10000/1d\\\",\\n        \\\"sendPinPerPhoneNumberLimit\\\": \\\"3/1d\\\"\\n    },\\n    \\\"enabled\\\": true,\\n    \\\"processId\\\": \\\"B63B57356B996AF0E2EC669EDDD14980\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"[name : may not be null]\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Name parameter missing\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"[configuration.sendPinPerPhoneNumberLimit : Limit format should be \\\\\\\"{attempts}/{timeLength}{timeUnit}\\\\\\\". Time units can be: ms, s, m, h, d]\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect limit format\"\n    },\n    {\n      \"code\": \"{\\n    \\\"requestError\\\": {\\n        \\\"serviceException\\\": {\\n            \\\"messageId\\\": \\\"BAD_REQUEST\\\",\\n            \\\"text\\\": \\\"[configuration.pinTimeToLive : Time format should be \\\\\\\"{timeLength}{timeUnit}\\\\\\\". Time units can be: ms, s, m, h, d]\\\"\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Incorrect time format\"\n    }\n  ]\n}\n[/block]","excerpt":"Create and manage your 2FA application.","slug":"2fa-application-setup","type":"basic","title":"Application setup"}

Application setup

Create and manage your 2FA application.

The application represents your service. It's a good practice to have separate applications for separate services. You may also have separate applications for the same service but different use cases. For example, 2FA for login may be represented as one application and 2FA for changing password as another. Separating use cases in different applications will allow you to choose different options and behavior for for each use case (like PIN attempts or PIN limits). [block:callout] { "type": "info", "body": "Creating application is the first step of the 2FA setup process. See [2FA Introduction](/docs/2fa-introduction-and-setup) to learn about next steps." } [/block] On this page you will find how to: * [Create new application](#section-resource) * [List all applications](#list-all-applications) * [Get application by ID](#get-application-by-id) * [Update application](#update-application) ##Resource ``` https://api.infobip.com/2fa/2/applications ``` ##Resource description |Parameter|Type|Description| |-|-|-| |*name* *|string|2FA application name| |*enabled*|boolean|Indicates if the created application is enabled.| |*configuration*|object|Created 2FA application configuration.| |> *pinAttempts*|integer|Number of possible PIN attempts.<br>Default value: `10`| |> *pinTimeToLive*|string|PIN time to live.<br>Default value: `15m` ([Time format](#section-time-format))| |> *verifyPinLimit*|string|Number of PIN verification requests in time interval from one phone number (MSISDN). <br>Default value: `1/3s` ([Limit format](#section-limit-format))| |> *sendPinPerApplicationLimit*|string|Overall number of requests in time interval for generating a PIN and sending an SMS using single application.<br>Default value: `10000/1d` ([Limit format](#section-limit-format))| |> *sendPinPerPhoneNumberLimit*|string|Number of requests in time interval for generating a PIN and sending an SMS to one phone number (MSISDN).<br>Default value: `3/1d` ([Limit format](#section-limit-format))| |> *allowMultiplePinVerifications*|boolean|Default value: true. Tells if multiple PIN verification are allowed.| |*applicationId*|string|2FA application ID.| |*name*|string|2FA application name.| |*enabled*|boolean|Indicates if the created application is enabled.| |*processId*|string|Process tracking ID. You can track conversion rate across 2FA process using multiple parameters.| ###Time format * Format: {timeLength}{timeUnit} * timeLength: positive integer * timeUnit: milliseconds `ms`, seconds `s`, minutes `m`, hours `h`, days `d` * Examples: `15m`, `1h`, `2d` ###Limit format * Format: {attempts}/{timeLength}{timeUnit} * attempts: positive integer * timeLength: positive integer * timeUnit: milliseconds `ms`, seconds `s`, minutes `m`, hours `h`, days `d` * Examples: `10/15m`, `2/10s` [block:api-header] { "type": "basic", "title": "Create new application" } [/block] Use this method to create a new application. ``` POST https://api.infobip.com/2fa/2/applications ``` ###Request example [block:code] { "codes": [ { "code": "POST /2fa/2/applications HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"name\":\"Test application BASIC\",\n\t\"configuration\": {\n\t \"pinAttempts\": 10,\n\t \"allowMultiplePinVerifications\": true,\n\t \"pinTimeToLive\": \"15m\",\n\t \"verifyPinLimit\": \"1/3s\",\n\t \"sendPinPerApplicationLimit\": \"10000/1d\",\n\t \"sendPinPerPhoneNumberLimit\": \"3/1d\"\n\t},\n\t\"enabled\": true\n}", "language": "json", "name": "JSON" }, { "code": "POST /2fa/2/applications HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"configuration\": {\n\t \"pinAttempts\": 10\n\t}\n}", "language": "json", "name": "Name parameter missing" }, { "code": "POST /2fa/2/applications HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"name\":\"Test application BASIC\",\n\t\"configuration\": {\n\t \"sendPinPerApplicationLimit\": \"10000/WRONG_LIMIT_FORMAT\"\n\t}\n}", "language": "json", "name": "Incorrect limit format" }, { "code": "POST /2fa/2/applications HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"name\":\"Test application BASIC\",\n\t\"configuration\": {\n\t \"pinTimeToLive\": \"WRONG_TIME_FORMAT\"\n\t}\n}", "language": "json", "name": "Incorrect time format" } ] } [/block] Response: [block:code] { "codes": [ { "code": "{\n \"applicationId\": \"797493BB352B7B84588F108CEBAAE43E\",\n \"name\": \"Test application BASIC\",\n \"configuration\": {\n \"pinAttempts\": 10,\n \"allowMultiplePinVerifications\": true,\n \"pinTimeToLive\": \"15m\",\n \"verifyPinLimit\": \"1/3s\",\n \"sendPinPerApplicationLimit\": \"10000/1d\",\n \"sendPinPerPhoneNumberLimit\": \"3/1d\"\n },\n \"enabled\": true,\n \"processId\": \"7C07B00C815FE79426ABD09702F2352F\"\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"[name : may not be null]\"\n }\n }\n}", "language": "json", "name": "Name parameter missing" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"[configuration.sendPinPerApplicationLimit : Limit format should be \\\"{attempts}/{timeLength}{timeUnit}\\\". Time units can be: ms, s, m, h, d]\"\n }\n }\n}", "language": "json", "name": "Incorrect limit format" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"[configuration.pinTimeToLive : Time format should be \\\"{timeLength}{timeUnit}\\\". Time units can be: ms, s, m, h, d]\"\n }\n }\n}", "language": "json", "name": "Incorrect time format" } ] } [/block] [block:api-header] { "title": "List all applications" } [/block] Use this method to get all 2FA applications for your account. ``` GET https://api.infobip.com/2fa/2/applications/ ``` ###Request example [block:code] { "codes": [ { "code": "GET /2fa/2/applications HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "language": "json", "name": "JSON" } ] } [/block] Response: [block:code] { "codes": [ { "code": "[\n {\n \"applicationId\": \"0933F3BC087D2A617AC6DCB2EF5B8A61\",\n \"name\": \"Test application BASIC 1\",\n \"configuration\": {\n \"pinAttempts\": 10,\n \"allowMultiplePinVerifications\": true,\n \"pinTimeToLive\": \"2h\",\n \"verifyPinLimit\": \"1/3s\",\n \"sendPinPerApplicationLimit\": \"10000/1d\",\n \"sendPinPerPhoneNumberLimit\": \"3/1d\"\n },\n \"enabled\": true,\n \"processId\": \"B63B57356B996AF0E2EC669EDDD14980\"\n },\n {\n \"applicationId\": \"5F04FACFAA4978F62FCAEBA97B37E90F\",\n \"name\": \"Test application BASIC 2\",\n \"configuration\": {\n \"pinAttempts\": 12,\n \"allowMultiplePinVerifications\": true,\n \"pinTimeToLive\": \"10m\",\n \"verifyPinLimit\": \"2/1s\",\n \"sendPinPerApplicationLimit\": \"10000/1d\",\n \"sendPinPerPhoneNumberLimit\": \"5/1h\"\n },\n \"enabled\": true,\n \"processId\": \"281EE180A3260FA64C74A5134634D6E8\"\n },\n {\n \"applicationId\": \"B450F966A8EF017180F148AF22C42642\",\n \"name\": \"Test application BASIC 3\",\n \"configuration\": {\n \"pinAttempts\": 15,\n \"allowMultiplePinVerifications\": true,\n \"pinTimeToLive\": \"1h\",\n \"verifyPinLimit\": \"30/10s\",\n \"sendPinPerApplicationLimit\": \"10000/3d\",\n \"sendPinPerPhoneNumberLimit\": \"10/20m\"\n },\n \"enabled\": true,\n \"processId\": \"3E4900A3F32CC96B461DD221C6EF7BEC\"\n }\n]", "language": "json", "name": "200 OK - JSON" } ] } [/block] [block:api-header] { "title": "Get single application" } [/block] Use this method to get the specific 2FA application identified by `applicationId` ``` GET https://api.infobip.com/2fa/2/applications/{applicationId} ``` ###Request example [block:code] { "codes": [ { "code": "GET /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "language": "json", "name": "JSON" }, { "code": "GET /2fa/2/applications/ID_DOESNT_EXIST HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==", "language": "json", "name": "ID doesn't exist" } ] } [/block] Response: [block:code] { "codes": [ { "code": "{\n \"applicationId\": \"0933F3BC087D2A617AC6DCB2EF5B8A61\",\n \"name\": \"Test application BASIC\",\n \"configuration\": {\n \"pinAttempts\": 10,\n \"allowMultiplePinVerifications\": true,\n \"pinTimeToLive\": \"2h\",\n \"verifyPinLimit\": \"1/3s\",\n \"sendPinPerApplicationLimit\": \"10000/1d\",\n \"sendPinPerPhoneNumberLimit\": \"3/1d\"\n },\n \"enabled\": true,\n \"processId\": \"B63B57356B996AF0E2EC669EDDD14980\"\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"Bad request\"\n }\n }\n}", "language": "json", "name": "ID doesn't exist" } ] } [/block] [block:api-header] { "title": "Update application" } [/block] Use this method to update your 2FA application that is already created. Application is identified by `applicationId` ``` PUT https://api.infobip.com/2fa/2/applications/{applicationId} ``` ###Request example [block:code] { "codes": [ { "code": "PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"name\":\"Test application BASIC\",\n\t\"configuration\": {\n\t \"pinAttempts\": 10,\n\t \"allowMultiplePinVerifications\": true,\n\t \"pinTimeToLive\": \"120m\",\n\t \"verifyPinLimit\": \"1/3s\",\n\t \"sendPinPerApplicationLimit\": \"10000/1d\",\n\t \"sendPinPerPhoneNumberLimit\": \"3/1d\"\n\t},\n\t\"enabled\": true\n}", "language": "json", "name": "JSON" }, { "code": "PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"configuration\": {\n\t \"pinAttempts\": 10\n\t}\n}", "language": "json", "name": "Name parameter missing" }, { "code": "PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"name\":\"Test application BASIC\",\n\t\"configuration\": {\n\t \"sendPinPerPhoneNumberLimit\": \"WRONG_LIMIT_FORMAT/30m\"\n\t}\n}", "language": "json", "name": "Incorrect limit format" }, { "code": "PUT /2fa/2/applications/0933F3BC087D2A617AC6DCB2EF5B8A61 HTTP/1.1\nHost: api.infobip.com\nContent-Type: application/json\nAccept: application/json\nAuthorization: Basic Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n\n{\n\t\"name\":\"Test application BASIC\",\n\t\"configuration\": {\n\t \"pinTimeToLive\": \"WRONG_TIME_FORMAT\"\n\t}\n}", "language": "json", "name": "Incorrect time format" } ] } [/block] Response: [block:code] { "codes": [ { "code": "{\n \"applicationId\": \"0933F3BC087D2A617AC6DCB2EF5B8A61\",\n \"name\": \"Test application BASIC\",\n \"configuration\": {\n \"pinAttempts\": 10,\n \"allowMultiplePinVerifications\": true,\n \"pinTimeToLive\": \"2h\",\n \"verifyPinLimit\": \"1/3s\",\n \"sendPinPerApplicationLimit\": \"10000/1d\",\n \"sendPinPerPhoneNumberLimit\": \"3/1d\"\n },\n \"enabled\": true,\n \"processId\": \"B63B57356B996AF0E2EC669EDDD14980\"\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"[name : may not be null]\"\n }\n }\n}", "language": "json", "name": "Name parameter missing" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"[configuration.sendPinPerPhoneNumberLimit : Limit format should be \\\"{attempts}/{timeLength}{timeUnit}\\\". Time units can be: ms, s, m, h, d]\"\n }\n }\n}", "language": "json", "name": "Incorrect limit format" }, { "code": "{\n \"requestError\": {\n \"serviceException\": {\n \"messageId\": \"BAD_REQUEST\",\n \"text\": \"[configuration.pinTimeToLive : Time format should be \\\"{timeLength}{timeUnit}\\\". Time units can be: ms, s, m, h, d]\"\n }\n }\n}", "language": "json", "name": "Incorrect time format" } ] } [/block]