1. Create an application

To create an application you can either use the target URI with a POST HTTP request or also include in your request body the application parameters that will deviate from the default values.

Basic Example for creating an application with body (JSON)

curl \
-X POST \
-H "apikey: yourApiKey" \
-d '{ \ 
  "alphanumeric": false, \ 
   "attempts": 5, \ 
   "expire": 1500, \ 
   "name": "WEBSITE1", \ 
   "pinLength": 6, \ 
   "sender": "ACME" \ 
 }' \
https://api.tyntec.com/2fa/v1/application/

Basic Example for creating an application without body (JSON)

curl \
-X POST \
-H "apikey: yourApiKey" \
https://api.tyntec.com/2fa/v1/application/

Response to Basic Example for creating an application without body (JSON)

HTTP/1.1 200 OK
{ 
    accountId: 'your account id',
    applicationId: '4b5b626d-d79f-3c88-a139-cac021a95a7e',
    name: 'App-1499676371415',
    pinLength: 4,
    alphanumeric: false,
    attempts: 3,
    expire: 300,
    template: 
     { en: 'OTP code: {{OTP}}. Valid for {{SEC}} seconds.' },
    sender: 'VERIFY',
    created: 1499676371415 
} 

Unsuccessful Request Response (JSON)

HTTP/1.1 400 Bad Request
{"message":"Cannot create application with name 'default'","code":"1017","timestamp":1499762022924}