{"__v":5,"_id":"562105ce40e2c30d0002a8a3","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"},"editedParams":true,"editedParams2":true,"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-16T14:12:30.361Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"POST /2fa/1/applications HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n  \"name\":\"Test application BASIC\"\n}","language":"json"}]},"results":{"codes":[{"name":"","code":"{\n \"applicationId\": \"CD265875E3A6EA43478D5F37A635BE4A\",\n \"name\": \"Test application BASIC\",\n \"configuration\": {\n      \"pinTimeToLive\": 1800000,\n      \"pinAttempts\": 3,\n      \"verificationAttempts\": 2,\n      \"verificationIntervalLength\": 10000,\n      \"initiationAttempts\": 5,\n      \"initiationIntervalLength\": 1800000,\n      \"overallInitiationAttempts\": 10000,\n      \"overallInitiationIntervalLength\": 86400000,\n      \"initiationThrottlingProlongationFactor\": 1,\n      \"initiationThrottlingWaitPeriod\": 0,\n   \t\t\"allowMultiplePinVerifications\": true\n \t\t\t},\n \"enabled\": true,\n \"processId\": \"F3F887000261BC35CADFADCC947F7EF8\"\n}","language":"json","status":200},{"name":"Invalid argument","code":"{\n  \"requestError\": {\n    \"serviceException\": {\n      \"messageId\": \"INVALID_ARGUMENT\",\n      \"text\": \"Invalid argument\"\n    }\n  }\n}","language":"json","status":400},{"code":"{\n  \"requestError\": {\n    \"serviceException\": {\n      \"messageId\": \"THROTTLE_EXCEPTION\",\n      \"text\": \"Too many requests. Try again later.\"\n    }\n  }\n}","language":"json","status":429}]},"settings":"","auth":"required","params":[{"_id":"562106bc7c515c0d008eee67","ref":"","in":"body","required":true,"desc":"2FA application name.","default":"","type":"string","name":"name"},{"_id":"562106bc7c515c0d008eee66","ref":"","in":"body","required":false,"desc":"Enabling or disabling 2FA application. <br> You can start 2-factor authentication process only if the 2FA application is enabled.","default":"true","type":"boolean","name":"enabled"},{"_id":"562107eeb244890d00186907","ref":"","in":"body","required":false,"desc":"PIN time to live (in mills). <br>*Default value:* 900.000 milliseconds (15 minutes)","default":"","type":"int","name":"pinTimeToLive"},{"_id":"562107eeb244890d00186906","ref":"","in":"body","required":false,"desc":"Number of possible PIN attempts. <br>*Default value:* 10","default":"","type":"int","name":"pinAttempts"},{"_id":"562107eeb244890d00186905","ref":"","in":"body","required":false,"desc":"Number of PIN verification requests from one phone number (MSISDN) in a defined verification time interval. <br>*Default value:* 1","default":"","type":"int","name":"verificationAttempts"},{"_id":"562107eeb244890d00186904","ref":"","in":"body","required":false,"desc":"Verification time interval (in mills). <br>*Default value:* 3.000 milliseconds (3 seconds)","default":"","type":"int","name":"verificationIntervalLength"},{"_id":"562107eeb244890d00186903","ref":"","in":"body","required":false,"desc":"Number of requests for generating a PIN and sending an SMS to one phone number (MSISDN) in a defined time interval. <br>*Default value:* 3","default":"","type":"int","name":"initiationAttempts"},{"_id":"562107eeb244890d00186902","ref":"","in":"body","required":false,"desc":"Time interval in which a defined number of initiation attempts for one phone number (MSISDN) can be realized. <br>*Default value:* 86.400.000 milliseconds (1 day)","default":"","type":"int","name":"initiationIntervalLength"},{"_id":"573b1e959fb8032b00158f30","ref":"","in":"body","required":false,"desc":"Overall number of requests for generating a PIN and sending an SMS using single application in a defined time interval. <br>*Default value:* 10000","default":"","type":"int","name":"overallInitiationAttempts"},{"_id":"573b1e959fb8032b00158f2f","ref":"","in":"body","required":false,"desc":"Time interval in which a defined number of initiation attempts for a single application can be realized. <br>*Default value:* 86.400.000 milliseconds (1 day)","default":"","type":"int","name":"overallInitiationIntervalLength"},{"_id":"56260a02d0f87e190014c515","ref":"","in":"body","required":false,"desc":"Tells if multiple pin verifications are allowed.","default":"true","type":"boolean","name":"allowMultiplePinVerifications"}],"url":"/2fa/:version/applications"},"isReference":true,"order":2,"body":"## Response format\n\nOn success, response header HTTP status code will be `200 OK`. \n\nOn error, you will receive an [error response status code](doc:2fa-status-codes-and-error-details) in the header and the response body will contain an [error object](doc:2fa-status-codes-and-error-details). If you try to create an application when you do not have the user’s authorization, you will receive an error `401` Unauthorized.\n\n### Response\n\n|Parameter|Type|Description|\n|-|-|-|\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. <br>You can track conversion rate across 2FA process using multiple parameters. *[Contact us for more information](mailto:2fa:::at:::infobip.com)*.|\n|*configuration*|[ApplicationConfiguration](#section-applicationconfiguration)|Created 2FA application configuration.|\n\n#### ApplicationConfiguration\n\n|Parameter|Type|Description|\n|:----|:----|:----------|\n|*pinTimeToLive*|Long|**Optional.** PIN time to live (in millis).<br><br>*Default value:* 900.000 milliseconds (15 minutes)|\n|*pinAttempts*|Integer|**Optional.** Number of possible PIN attempts.<br><br>*Default value:* 10|\n|*verificationAttempts*|Integer|**Optional.** Number of PIN verification requests from one phone number (MSISDN) in a defined verification time interval.<br><br>*Default value:* 1|\n|*verificationIntervalLength*|Long|**Optional.** Verification time interval (in millis).<br><br>*Default value:* 3.000 milliseconds (3 seconds)|\n|*initiationAttempts*|Integer|**Optional.** Number of requests for generating a PIN and sending an SMS to one phone number (MSISDN) in a defined time interval.<br><br>*Default value:* 3|\n|*initiationIntervalLength*|Long|**Optional.** Time interval in which a defined number of initiation attempts for one phone number (MSISDN) can be realized.<br><br>*Default value:* 86.400.000 milliseconds (1 day)|\n|*overallInitiationAttempts*|Integer|**Optional.** Overall number of requests for generating a PIN and sending an SMS using single application in a defined time interval.<br><br>*Default value:* 10000|\n|*overallInitiationIntervalLength*|Integer|**Optional.** Time interval in which a defined number of initiation attempts for a single application can be realized.<br><br>*Default value:* 86.400.000 milliseconds (1 day)|\n|*allowMultiplePinVerifications*|Boolean|**Optional.** Tells if multiple pin verifications are allowed.|\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional example\"\n}\n[/block]\n## Create application with all available parameters (required and optional)\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /2fa/1/applications HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"name\\\":\\\"Test application ADVANCED\\\",\\n  \\\"enabled\\\":true,\\n  \\\"configuration\\\":{\\n      \\\"pinTimeToLive\\\":2000000,\\n      \\\"pinAttempts\\\":5,\\n      \\\"verificationAttempts\\\":3,\\n      \\\"verificationIntervalLength\\\":12000,\\n      \\\"initiationAttempts\\\":8,\\n      \\\"initiationIntervalLength\\\":1800000,\\n      \\\"overallInitiationAttempts\\\":10000,\\n      \\\"overallInitiationIntervalLength\\\":86400000,\\n   \\t\\t\\\"allowMultiplePinVerifications\\\": false\\n    }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n \\\"applicationId\\\": \\\"HJ675435E3A6EA43432G5F37A635KJ8B\\\",\\n \\\"name\\\": \\\"Test application ADVANCED\\\",\\n \\\"configuration\\\": {\\n      \\\"pinTimeToLive\\\": 2000000,\\n      \\\"pinAttempts\\\": 5,\\n      \\\"verificationAttempts\\\": 3,\\n      \\\"verificationIntervalLength\\\": 12000,\\n      \\\"initiationAttempts\\\": 8,\\n      \\\"initiationIntervalLength\\\": 1800000,\\n      \\\"overallInitiationAttempts\\\": 10000,\\n      \\\"overallInitiationIntervalLength\\\": 86400000,\\n      \\\"initiationThrottlingProlongationFactor\\\": 1,\\n      \\\"initiationThrottlingWaitPeriod\\\": 0,\\n   \\t\\t\\\"allowMultiplePinVerifications\\\": false\\n\\n     },\\n \\\"enabled\\\": true,\\n \\\"processId\\\": \\\"F3F887000261BC35CADFADCC947F7EF8\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to create 2FA application.","slug":"application-create","type":"post","title":"Application: Create"}

postApplication: Create

This method allows you to create 2FA application.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

name:
required
string
2FA application name.
enabled:
booleantrue
Enabling or disabling 2FA application. <br> You can start 2-factor authentication process only if the 2FA application is enabled.
pinTimeToLive:
integer
PIN time to live (in mills). <br>*Default value:* 900.000 milliseconds (15 minutes)
pinAttempts:
integer
Number of possible PIN attempts. <br>*Default value:* 10
verificationAttempts:
integer
Number of PIN verification requests from one phone number (MSISDN) in a defined verification time interval. <br>*Default value:* 1
verificationIntervalLength:
integer
Verification time interval (in mills). <br>*Default value:* 3.000 milliseconds (3 seconds)
initiationAttempts:
integer
Number of requests for generating a PIN and sending an SMS to one phone number (MSISDN) in a defined time interval. <br>*Default value:* 3
initiationIntervalLength:
integer
Time interval in which a defined number of initiation attempts for one phone number (MSISDN) can be realized. <br>*Default value:* 86.400.000 milliseconds (1 day)
overallInitiationAttempts:
integer
Overall number of requests for generating a PIN and sending an SMS using single application in a defined time interval. <br>*Default value:* 10000
overallInitiationIntervalLength:
integer
Time interval in which a defined number of initiation attempts for a single application can be realized. <br>*Default value:* 86.400.000 milliseconds (1 day)
allowMultiplePinVerifications:
booleantrue
Tells if multiple pin verifications are allowed.

Examples


Result Format


Documentation

## Response format On success, response header HTTP status code will be `200 OK`. On error, you will receive an [error response status code](doc:2fa-status-codes-and-error-details) in the header and the response body will contain an [error object](doc:2fa-status-codes-and-error-details). If you try to create an application when you do not have the user’s authorization, you will receive an error `401` Unauthorized. ### Response |Parameter|Type|Description| |-|-|-| |*applicationId*|String|2FA application ID.| |*name*|String|2FA application name.| |*enabled*|Boolean|Indicates if the created application is enabled.| |*processId*|String|Process tracking ID. <br>You can track conversion rate across 2FA process using multiple parameters. *[Contact us for more information](mailto:2fa@infobip.com)*.| |*configuration*|[ApplicationConfiguration](#section-applicationconfiguration)|Created 2FA application configuration.| #### ApplicationConfiguration |Parameter|Type|Description| |:----|:----|:----------| |*pinTimeToLive*|Long|**Optional.** PIN time to live (in millis).<br><br>*Default value:* 900.000 milliseconds (15 minutes)| |*pinAttempts*|Integer|**Optional.** Number of possible PIN attempts.<br><br>*Default value:* 10| |*verificationAttempts*|Integer|**Optional.** Number of PIN verification requests from one phone number (MSISDN) in a defined verification time interval.<br><br>*Default value:* 1| |*verificationIntervalLength*|Long|**Optional.** Verification time interval (in millis).<br><br>*Default value:* 3.000 milliseconds (3 seconds)| |*initiationAttempts*|Integer|**Optional.** Number of requests for generating a PIN and sending an SMS to one phone number (MSISDN) in a defined time interval.<br><br>*Default value:* 3| |*initiationIntervalLength*|Long|**Optional.** Time interval in which a defined number of initiation attempts for one phone number (MSISDN) can be realized.<br><br>*Default value:* 86.400.000 milliseconds (1 day)| |*overallInitiationAttempts*|Integer|**Optional.** Overall number of requests for generating a PIN and sending an SMS using single application in a defined time interval.<br><br>*Default value:* 10000| |*overallInitiationIntervalLength*|Integer|**Optional.** Time interval in which a defined number of initiation attempts for a single application can be realized.<br><br>*Default value:* 86.400.000 milliseconds (1 day)| |*allowMultiplePinVerifications*|Boolean|**Optional.** Tells if multiple pin verifications are allowed.| [block:api-header] { "type": "basic", "title": "Additional example" } [/block] ## Create application with all available parameters (required and optional) **Request** [block:code] { "codes": [ { "code": "POST /2fa/1/applications HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"name\":\"Test application ADVANCED\",\n \"enabled\":true,\n \"configuration\":{\n \"pinTimeToLive\":2000000,\n \"pinAttempts\":5,\n \"verificationAttempts\":3,\n \"verificationIntervalLength\":12000,\n \"initiationAttempts\":8,\n \"initiationIntervalLength\":1800000,\n \"overallInitiationAttempts\":10000,\n \"overallInitiationIntervalLength\":86400000,\n \t\t\"allowMultiplePinVerifications\": false\n }\n}", "language": "json" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"applicationId\": \"HJ675435E3A6EA43432G5F37A635KJ8B\",\n \"name\": \"Test application ADVANCED\",\n \"configuration\": {\n \"pinTimeToLive\": 2000000,\n \"pinAttempts\": 5,\n \"verificationAttempts\": 3,\n \"verificationIntervalLength\": 12000,\n \"initiationAttempts\": 8,\n \"initiationIntervalLength\": 1800000,\n \"overallInitiationAttempts\": 10000,\n \"overallInitiationIntervalLength\": 86400000,\n \"initiationThrottlingProlongationFactor\": 1,\n \"initiationThrottlingWaitPeriod\": 0,\n \t\t\"allowMultiplePinVerifications\": false\n\n },\n \"enabled\": true,\n \"processId\": \"F3F887000261BC35CADFADCC947F7EF8\"\n}", "language": "json" } ] } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}