API Reference
made for developers
Highlighted on page

    Introduction

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    First off, big thanks for building with tyntec’s APIs! This is where you can access our API reference docs and support for tyntec’s services. With our APIs you can access tyntec’s API endpoints and get the resources you need to use our services.

    We provide language bindings in Shell, HTTP, JavaScript, Node.JS, Ruby, Python, Java and Go! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

    This API reference is available in the following URL:

    We are happy to support you. Please contact us though mail or our web site:

    Authentication

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    • API Key (ApiKeyAuth)
      • Parameter Name: apikey, in: header.

    Chat API - v1.1

    Welcome to tyntecs Chat API.

    It enables you to easily send messages to your customers via messaging services like WhatsApp or Viber and still address customers with classic SMS.

    In addition you can define a chain of channels which will be used for messaging attempts until one succeeds.

    Base URLs:

    Send messages

    In this section we guide you on how to send messages, get information about the status and the events happening during the delivery

    Send a message

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/messaging/v1/chat/messages", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X POST https://api.tyntec.com/messaging/v1/chat/messages \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    POST https://api.tyntec.com/messaging/v1/chat/messages HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/chat/messages");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    const inputBody = '{
      "to": "+123234234",
      "channels": [
        "whatsapp"
      ],
      "whatsapp": {
        "from": 545345345,
        "contentType": "text",
        "text": "A simple text message"
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "to": "+123234234",
      "channels": [
        "whatsapp"
      ],
      "whatsapp": {
        "from": 545345345,
        "contentType": "text",
        "text": "A simple text message"
      }
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/messaging/v1/chat/messages', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/messaging/v1/chat/messages',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /messages

    Send chat messages via this path.

    Body parameter

    {
      "to": "+123234234",
      "channels": [
        "whatsapp"
      ],
      "whatsapp": {
        "from": 545345345,
        "contentType": "text",
        "text": "A simple text message"
      }
    }
    
    Parameters
    Name In Type Required Description
    body body MessageRequest false none

    Example responses

    202 Response

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "acceptedAt": "2019-03-13T13:56:10Z"
    }
    

    Responses

    Status Meaning Description Schema
    202 Accepted The message is accepted by our system MessageResponse
    400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
    default Default For all other error cases please check the problem object Problem

    Retrieve the message

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/messaging/v1/chat/messages/{message-id}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/messaging/v1/chat/messages/{message-id} \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/messaging/v1/chat/messages/{message-id} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/chat/messages/{message-id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/messaging/v1/chat/messages/{message-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /messages/{message-id}

    Returns back a message previously send by you.

    Please note After a final status notification (delivered, read or failed) the message is only available for the next 48 hours. After this period we delete the message in our system.

    Parameters
    Name In Type Required Description
    message-id path string(uuid) true The id of the message

    Example responses

    200 Response

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "to": "+123234234",
      "channels": [
        "whatsapp"
      ],
      "whatsapp": {
        "from": 545345345,
        "contentType": "text",
        "text": "A simple text message"
      }
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The message id requested exists. StoredMessage
    404 Not Found The message id does not exists in our system None
    default Default For all other error cases please check the problem object Problem

    View message history

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/history',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /messages/{message-id}/history

    Get the history of the message.

    This will give you detailed information about the delivery flow of the message.

    Parameters
    Name In Type Required Description
    message-id path string(uuid) true The id of the message

    Example responses

    200 Response

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "history": [
        {
          "deliveryChannel": "whatsapp",
          "happendAt": "2019-03-13T12:57:27.048Z",
          "state": "accepted"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The history of the message id. MessageHistory
    404 Not Found The message id does not exists in our system None
    default Default For all other error cases please check the problem object Problem

    Receive messages

    In order to receive messages send by the user you need to configure first an public available endpoint.

    We will send you messages as defined in MoMessage.

    Media send by the user can be downloaded by - either by following the link in the MoMedia object or - by using the received media id and query our system via /media/{media-id} (see below)

    Download received media

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"audio/*"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/messaging/v1/chat/media/{media-id}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/messaging/v1/chat/media/{media-id} \
      -H 'Accept: audio/*' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/messaging/v1/chat/media/{media-id} HTTP/1.1
    Host: api.tyntec.com
    Accept: audio/*
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/chat/media/{media-id}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    
    const headers = {
      'Accept':'audio/*',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/media/{media-id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'audio/*',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/media/{media-id}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'audio/*',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/messaging/v1/chat/media/{media-id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'audio/*',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/messaging/v1/chat/media/{media-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /media/{media-id}

    Retrieve the media associated with the id

    Parameters
    Name In Type Required Description
    media-id path string(uuid) true The id of the media to be downloaded

    Example responses

    200 Response

    default Response

    {
      "type": "https://docs.tyntec.com/problems/DataNotParseable",
      "title": "Data given was not parseable",
      "status": 400,
      "detail": "Unexpected end-of-input: expected close marker for Object (start marker at [Source: UNKNOWN; line: -1, column: -1) at [Source: UNKNOWN; line: 1, column: 97]\n"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The media associated with the id requested exists. string
    404 Not Found The media associated with the id does not exists in our system None
    default Default For all other error cases please check the problem object Problem

    Notifications

    Notifications or DLRs are send to your system when a message reaches a final state.

    The notification message is the same as for the message status you can query MessageStatus.

    Check message status

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/messaging/v1/chat/messages/{message-id}/status',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /messages/{message-id}/status

    Check status of the message

    Parameters
    Name In Type Required Description
    message-id path string(uuid) true The id of the message

    Example responses

    200 Response

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "deliveryChannel": "whatsapp",
      "status": "seen"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The message id requested exists. MessageStatus
    404 Not Found The message id does not exists in our system None
    default Default For all other error cases please check the problem object Problem

    Schemas

    MessageRequest

    {
      "to": "+123234234",
      "channels": [
        "whatsapp"
      ],
      "whatsapp": {
        "from": 545345345,
        "contentType": "text",
        "text": "A simple text message"
      }
    }
    
    

    Properties

    Name Type Required Restrictions Description
    to string true none The receipient phone number in international format. It should follow the guidelines of E.164 but leading 00 is as well accepted
    channels Channels true none none
    defaultContent DefaultContent false none The default content that is applied to all channels. Each component might be overrwritten or extended by channel specific settings. This can be used to specify the text for a message once, but the from per used channel.
    sms SMSRequest false none Normal SMS to be send. If Content is used as well this will override the specification made there. In case URL type is specified the recipient will receive the plain URL as SMS.
    whatsapp WhatsappMessageRequest false none Whatsapp message to be send. This will override defaults from DefaultContent
    tyntecEcho TyntecEchoRequest false none This channel can be used for integration purposes without sending any message to an actual device. A detailed description is provided on the object definition.

    StoredMessage

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "to": "+123234234",
      "channels": [
        "whatsapp"
      ],
      "whatsapp": {
        "from": 545345345,
        "contentType": "text",
        "text": "A simple text message"
      }
    }
    
    

    Properties

    Name Type Required Restrictions Description
    to string true none The receipient phone number in international format. It should follow the guidelines of E.164 but leading 00 is as well accepted
    channels Channels true none none
    sms SMSRequest false none Normal SMS to be send. If Content is used as well this will override the specification made there. In case URL type is specified the recipient will receive the plain URL as SMS.
    whatsapp WhatsappMessageRequest false none Whatsapp message to be send. This will override defaults from DefaultContent
    tyntecEcho TyntecEchoRequest false none This channel can be used for integration purposes without sending any message to an actual device. A detailed description is provided on the object definition.

    DefaultContent

    {
      "from": 1233423454,
      "contentType": "template",
      "template": {
        "templateId": "welcome_message",
        "language": {
          "policy": "deterministic",
          "code": "en"
        },
        "parameters": [
          {
            "default": "Mr. Doe"
          }
        ]
      }
    }
    
    

    The default content that is applied to all channels.

    Each component might be overrwritten or extended by channel specific settings.

    This can be used to specify the text for a message once, but the from per used channel.

    Properties

    Name Type Required Restrictions Description
    from string true none The sender of the message
    contentType string true none What kind of payload is used
    text string false none The text to be send
    url string false none the URL you would like to send. Must be a valid http(s) URL
    media Media false none none
    template Template false none The message template to be send.
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media

    SMSRequest

    {
      "contentType": "text",
      "from": 1233423454,
      "text": "Thanks for contacting our support. We will get back to you in 5 minutes."
    }
    
    

    Normal SMS to be send.

    If Content is used as well this will override the specification made there.

    In case URL type is specified the recipient will receive the plain URL as SMS.

    Properties

    Name Type Required Restrictions Description
    contentType string false none What kind of payload should be sent
    from string false none The sender of the message
    text string false none The message to be send
    url string false none the URL you would like to send. Must be a valid http(s) URL
    Enumerated Values
    Property Value
    contentType text
    contentType url

    WhatsappMessageRequest

    {
      "from": 1233423454,
      "contentType": "media",
      "media": {
        "type": "audio",
        "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec-logo-color.svg",
        "caption": "Tyntec Logo"
      }
    }
    
    

    Whatsapp message to be send.

    This will override defaults from DefaultContent

    Properties

    Name Type Required Restrictions Description
    from string true none The sending whatsapp account
    contentType string true none What kind of payload is used
    text string false none The text to be send
    url string false none the URL you would like to send. Must be a valid http(s) URL
    media Media false none none
    template Template false none The message template to be send.
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media

    TyntecEchoRequest

    {
      "from": 1233423454,
      "contentType": "url",
      "url": "https://www.tyntec.com",
      "replyBack": false
    }
    
    

    This channel can be used for integration purposes without sending any message to an actual device.

    It has two modes

    • only send the delivered dlr back
    • send additionally a message back

    The messages send back follow these rules :

    • media, text and url are send back as they are
    • templates are formatted as TemplateId[templateId] LanguagePolicy[language.policy] LanguageCode[language.code] Parameter<N>[parameters[N]]
    • from and to switch positions
    • messageId will be the same as for the request

    Properties

    Name Type Required Restrictions Description
    from string true none The sending tyntecEcho account
    contentType string true none What kind of payload is used
    text string false none The text to be send
    url string false none the URL you would like to send. Must be a valid http(s) URL
    media Media false none none
    template Template false none The message template to be send.
    replyBack boolean false none Should the channel reply back the send message
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media

    Media

    {
      "type": "image",
      "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec-logo-color.svg",
      "caption": "Tyntec Logo"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    type string false none What kind of media should be send
    url string false none the url of the location where the media is stored
    caption string false none additional caption for the media. is shown on the uploaded media when the channel supports this
    Enumerated Values
    Property Value
    type image
    type document
    type audio

    Template

    {
      "templateId": "welcome_message",
      "language": {
        "policy": "deterministic",
        "code": "en"
      },
      "parameters": [
        {
          "default": "Mr. Doe"
        }
      ]
    }
    
    

    The message template to be send.

    Properties

    Name Type Required Restrictions Description
    templateId string true none the identifier of the template that should be used
    language Language true none none
    parameters [TemplateParameter] false none none

    Language

    {
      "policy": "deterministic",
      "code": "en"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    policy string false none none
    code string false none The code of the language or locale to use — Accepts both language and language_locale formats (e.g., en and en_US).
    Enumerated Values
    Property Value
    policy fallback
    policy deterministic

    TemplateParameter

    {
      "default": "Mr. Doe"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    default string false none none

    Channels

    [
      "sms",
      "whatsapp"
    ]
    
    

    Properties

    None

    MessageResponse

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "acceptedAt": "2019-03-13T13:56:10Z"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    messageId string(uuid) true none Global Message Id reference
    acceptedAt string(date-time) true none Point in time when the Chat API service confirms that the message request was accepted

    MessageStatus

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "deliveryChannel": "whatsapp",
      "status": "seen"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    messageId string(uuid) true none Global Message Id reference
    deliveryChannel string false none none
    status string true none Indicates the status of the message. Be aware that not all channels support all status.
    Enumerated Values
    Property Value
    deliveryChannel sms
    deliveryChannel whatsapp
    deliveryChannel tyntecEcho
    status accepted
    status delivered
    status seen
    status failed
    status unknown

    MessageHistory

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "history": [
        {
          "deliveryChannel": "whatsapp",
          "happendAt": "2019-03-13T12:57:27.048Z",
          "state": "accepted"
        }
      ]
    }
    
    

    Properties

    Name Type Required Restrictions Description
    messageId string(uuid) false none Global Message Id reference
    history [HistoryItem] false none none

    HistoryItem

    {
      "deliveryChannel": "whatsapp",
      "happendAt": "2019-03-13T13:15:22Z",
      "state": "accepted"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    deliveryChannel string false none none
    happendAt string(date-time) false none none
    state string false none none
    details object false none none
    Enumerated Values
    Property Value
    deliveryChannel sms
    deliveryChannel whatsapp
    deliveryChannel tyntecEcho
    state accepted
    state dispatched
    state dispatching_failed
    state success
    state failed
    state unknown

    Problem

    {
      "type": "https://docs.tyntec.com/problems/DataNotParseable",
      "title": "Data given was not parseable",
      "status": 400,
      "detail": "Unexpected end-of-input: expected close marker for Object (start marker at [Source: UNKNOWN; line: -1, column: -1) at [Source: UNKNOWN; line: 1, column: 97]\n"
    }
    
    

    The problem object follows the RFC-7807 (https://tools.ietf.org/html/rfc7807)

    Properties

    Name Type Required Restrictions Description
    type string true none A URI reference [RFC3986] that identifies the problem type
    title string true none A short, human-readable summary of the problem type.
    status string true none The HTTP status code (RFC7231, Section 6) generated by the origin server for this occurrence of the problem.
    detail string true none A human-readable explanation specific to this occurrence of the problem.

    MoMessage

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697e",
      "from": 49123512314,
      "channel": "sms",
      "content": {
        "contentType": "text",
        "text": "hi, thanks for your support message"
      },
      "sms": {
        "origin": {
          "mcc": "string",
          "mnc": "string",
          "ttId": "string"
        },
        "totalPrice": 0,
        "size": 1,
        "missingParts": false,
        "parts": [
          {
            "messageId": "string",
            "sentDate": "2019-03-13T13:15:22Z",
            "price": 0,
            "currency": "string",
            "priceEffective": "2019-03-13T13:15:22Z",
            "sequenceNumber": 1
          }
        ]
      }
    }
    
    

    Properties

    Name Type Required Restrictions Description
    messageId string(uuid) true none Message Id reference
    from string true none the sender of the message
    channel string true none none
    content MoContent true none none
    sms SMS false none specifics of the sms channel
    whatsapp Whatsapp false none specifics of the whatsapp channel
    Enumerated Values
    Property Value
    channel sms
    channel whatsapp
    channel tyntecEcho

    MoContent

    {
      "contentType": "media",
      "media": {
        "type": "audio",
        "url": "https://api.tyntec.com/messaging/v1/chat/media/77185196-664a-43ec-b14a-fe97036c697f",
        "mediaId": "77185196-664a-43ec-b14a-fe97036c697f"
      }
    }
    
    

    Properties

    Name Type Required Restrictions Description
    contentType string true none What kind of payload is used
    text string false none The received text
    url string false none the URL received
    media MoMedia false none none
    Enumerated Values
    Property Value
    contentType text
    contentType url
    contentType media

    MoMedia

    {
      "type": "audio",
      "url": "https://api.tyntec.com/messaging/v1/chat/media/77185196-664a-43ec-b14a-fe97036c697f",
      "mediaId": "77185196-664a-43ec-b14a-fe97036c697f"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    type string false none What kind of media was received
    url string false none the url of the location where the media is stored
    mediaId string false none plain id of the media to download
    Enumerated Values
    Property Value
    type image
    type document
    type audio
    type voice

    SMS

    {
      "origin": {
        "mcc": 49,
        "mnc": 176,
        "ttId": 25
      },
      "totalPrice": 0.1,
      "size": 1,
      "missingParts": false,
      "parts": [
        {
          "messageId": "48514285-4e78-4eef-b0c6-4ce68d40c1c3",
          "sentDate": "2019-03-13T13:15:22Z",
          "price": 0,
          "currency": "EUR",
          "priceEffective": "2019-03-13T13:15:22Z",
          "sequenceNumber": 1
        }
      ]
    }
    
    

    specifics of the sms channel

    Properties

    Name Type Required Restrictions Description
    origin SMSOrigin false none none
    totalPrice number false none The sum of prices for each message part listed in “contentList”.
    size number false none The amount of respective concatenated SMS parts.
    missingParts boolean false none True in case a part of an over-length was not received by the tyntec platform and the forwarded message text is incomplete.
    parts [SMSContent] false none tyntec merges over-length (concatenated) SMS into one string before sending it to your webserver. Information for each individual part are collected here

    SMSOrigin

    {
      "mcc": 49,
      "mnc": 176,
      "ttId": 25
    }
    
    

    Properties

    Name Type Required Restrictions Description
    mcc string false none A representative MCC (Mobile Network Code) of the originating network.
    mnc string false none A representative MNC (Mobile Network Code) of the originating network.
    ttId string false none The respective tyntec ID of the originating network.

    SMSContent

    {
      "messageId": "48514285-4e78-4eef-b0c6-4ce68d40c1c3",
      "sentDate": "2019-03-13T13:56:10Z",
      "price": 0.1,
      "currency": "EUR",
      "priceEffective": "2019-03-13T13:56:10Z",
      "sequenceNumber": 1
    }
    
    

    Properties

    Name Type Required Restrictions Description
    messageId string false none The unique identifier provided by tyntec for each message part.
    sentDate string(date-time) false none The time stamp when the SMS has been received by the sending MSC (if available). or The time stamp when the respective message was received by tyntec.
    price number false none The price per message from the respective network. Negative prices represent payout in favor of tyntec’s customer.
    currency string false none The currency in which the pricing is given; corresponding to the currency of the invoice.
    priceEffective string(date-time) false none The date when the “price” became effective.
    sequenceNumber number false none In case an over-length message is received tyntec recomposes the full message text before forwarding. The “sequenceNumber” indicates the order of the message part.

    Whatsapp

    {}
    
    

    specifics of the whatsapp channel

    Properties

    None

    2FA API - v1.0

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    2FA Application Service

    Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

    Returns all applications created.

    Code samples

    # You can also use wget
    curl -X GET https://api.tyntec.com/2fa/v1/application/ \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/2fa/v1/application/ HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/2fa/v1/application/',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/2fa/v1/application/', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/2fa/v1/application/", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /2fa/v1/application/

    You can get the application id from the list to edit it

    Example responses

    200 Response

    [
      {
        "alphanumeric": false,
        "attempts": 3,
        "expire": 300,
        "name": "string",
        "pinLength": 4,
        "sender": "VERIFY",
        "caller": "VERIFY"
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The list of applications Inline
    204 No Content Empty list. No applications found for your account Inline
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Not Found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    anonymous [TwoFactorAuthApplicationEntity] false none none
    » 2FA applicaiton TwoFactorAuthApplicationEntity false none none
    »» alphanumeric boolean false none If the OTP is alphanumeric or not
    »» attempts integer(int32) false none How many attempts the user can have for this OTP
    »» expire integer(int64) false none How many seconds until OTP expires
    »» name string false none Custom application name
    »» pinLength integer(int32) false none The length of a pin
    »» sender string false none The sender used for SMS delivery
    »» caller string false none The caller used for TTS delivery. Using a valid number will improve filtering issues caused by anonymous calls

    Status Code 204

    Name Type Required Restrictions Description
    anonymous [TwoFactorAuthApplicationEntity] false none none
    » 2FA applicaiton TwoFactorAuthApplicationEntity false none none
    »» alphanumeric boolean false none If the OTP is alphanumeric or not
    »» attempts integer(int32) false none How many attempts the user can have for this OTP
    »» expire integer(int64) false none How many seconds until OTP expires
    »» name string false none Custom application name
    »» pinLength integer(int32) false none The length of a pin
    »» sender string false none The sender used for SMS delivery
    »» caller string false none The caller used for TTS delivery. Using a valid number will improve filtering issues caused by anonymous calls

    Creates a 2fa application

    Code samples

    # You can also use wget
    curl -X POST https://api.tyntec.com/2fa/v1/application/ \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/2fa/v1/application/ HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    var headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/2fa/v1/application/',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/2fa/v1/application/', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/2fa/v1/application/", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /2fa/v1/application/

    Creates an application instance. Values that are not defined will be populated with default values.

    Body parameter

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Parameters

    Name In Type Required Description
    body body TwoFactorAuthApplicationEntity false The application to be created.

    Example responses

    200 Response

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Not valid configuration provided

    Responses

    Status Meaning Description Schema
    200 OK The new application created TwoFactorAuthApplicationEntity
    400 Bad Request Not valid configuration provided ErrorResponse
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Not Found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Get a 2fa application

    Code samples

    # You can also use wget
    curl -X GET https://api.tyntec.com/2fa/v1/application/{applicationId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/2fa/v1/application/{applicationId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/{applicationId}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/{applicationId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/2fa/v1/application/{applicationId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/2fa/v1/application/{applicationId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/{applicationId}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/2fa/v1/application/{applicationId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /2fa/v1/application/{applicationId}

    Parameters

    Name In Type Required Description
    applicationId path string true applicationId

    Example responses

    200 Response

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The application is included in the response TwoFactorAuthApplicationEntity
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The id for this application is not valid None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Edit a 2fa application

    Code samples

    # You can also use wget
    curl -X POST https://api.tyntec.com/2fa/v1/application/{applicationId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/2fa/v1/application/{applicationId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/{applicationId}',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/{applicationId}',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/2fa/v1/application/{applicationId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/2fa/v1/application/{applicationId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/{applicationId}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/2fa/v1/application/{applicationId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /2fa/v1/application/{applicationId}

    Define the parameters that you would like to change

    Parameters

    Name In Type Required Description
    applicationId path string true applicationId
    name query string false name
    pinLength query integer(int32) false pinLength
    alphaNumeric query boolean false alphaNumeric
    attempts query integer(int32) false attempts
    expire query integer(int64) false expire
    sender query string false sender
    caller query string false caller
    deleteCaller query boolean false deleteCaller

    Example responses

    200 Response

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The application is included in the response TwoFactorAuthApplicationEntity
    201 Created Created None
    400 Bad Request Not valid configuration provided ErrorResponse
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The id for this application is not valid ErrorResponse
    500 Internal Server Error Something went wrong :-( None

    Delete a 2fa application

    Code samples

    # You can also use wget
    curl -X DELETE https://api.tyntec.com/2fa/v1/application/{applicationId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    DELETE https://api.tyntec.com/2fa/v1/application/{applicationId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/{applicationId}',
      method: 'delete',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/{applicationId}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.tyntec.com/2fa/v1/application/{applicationId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.delete('https://api.tyntec.com/2fa/v1/application/{applicationId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/{applicationId}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("DELETE");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.tyntec.com/2fa/v1/application/{applicationId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /2fa/v1/application/{applicationId}

    Existing Otps will still be valid but resend and verify them will not be possible

    Parameters

    Name In Type Required Description
    applicationId path string true applicationId

    Example responses

    200 Response

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The application was deleted TwoFactorAuthApplicationEntity
    204 No Content No Content None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The id for this application is not valid ErrorResponse
    500 Internal Server Error Something went wrong :-( None

    Add or update a language template

    Code samples

    # You can also use wget
    curl -X POST https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string&text=string \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string&text=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/{applicationId}/language',
      method: 'post',
      data: '?language=string&text=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string&text=string',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/2fa/v1/application/{applicationId}/language',
      params: {
      'language' => 'string',
    'text' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/2fa/v1/application/{applicationId}/language', params={
      'language': 'string',  'text': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string&text=string");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/2fa/v1/application/{applicationId}/language", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /2fa/v1/application/{applicationId}/language

    Existing Otps will still be valid but resend and verify them will not be possible

    Parameters

    Name In Type Required Description
    applicationId path string true applicationId
    language query string true language
    text query string true text
    channel query string false SMS/VOICE specific language template

    Example responses

    200 Response

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The application language template has been saved TwoFactorAuthApplicationEntity
    201 Created Created None
    400 Bad Request Wrong arguments provided ErrorResponse
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The id for this application is not valid ErrorResponse
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Delete a language template

    Code samples

    # You can also use wget
    curl -X DELETE https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    DELETE https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/application/{applicationId}/language',
      method: 'delete',
      data: '?language=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.tyntec.com/2fa/v1/application/{applicationId}/language',
      params: {
      'language' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.delete('https://api.tyntec.com/2fa/v1/application/{applicationId}/language', params={
      'language': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/application/{applicationId}/language?language=string");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("DELETE");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.tyntec.com/2fa/v1/application/{applicationId}/language", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /2fa/v1/application/{applicationId}/language

    The existing language will be deleted. Template for 'en' can not be deleted as it is the default one

    Parameters

    Name In Type Required Description
    applicationId path string true applicationId
    language query string true language
    channel query string false SMS/VOICE specific language template

    Example responses

    200 Response

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The language template was deleted TwoFactorAuthApplicationEntity
    204 No Content No Content None
    400 Bad Request Wrong arguments provided ErrorResponse
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The id for this application is not valid, or language does not exist None
    500 Internal Server Error Something went wrong :-( None

    2FA OTP Service

    2fa OTP Service

    Returns all OTP instances for a specific number

    Code samples

    # You can also use wget
    curl -X GET https://api.tyntec.com/2fa/v1/otp?number=string \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/2fa/v1/otp?number=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp',
      method: 'get',
      data: '?number=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp?number=string',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/2fa/v1/otp',
      params: {
      'number' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/2fa/v1/otp', params={
      'number': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp?number=string");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/2fa/v1/otp", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /2fa/v1/otp

    You can get the application id from the list to edit it

    Parameters

    Name In Type Required Description
    number query string true number

    Example responses

    200 Response

    [
      {
        "accountId": "string",
        "applicationId": "string",
        "attemptCount": 0,
        "created": 0,
        "expire": 0,
        "number": "string",
        "otpId": "string",
        "otpStatus": "string",
        "referenceId": "string",
        "timestampCreated": "string",
        "timestampExpire": "string"
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The list of OTPs Inline
    204 No Content Empty list. No OTPs found for this account Inline
    400 Bad Request Invalid number format provided ErrorResponse
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Not Found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    anonymous [OtpStatusEntity] false none none
    » Otp Status OtpStatusEntity false none none
    »» accountId string false none none
    »» applicationId string false none none
    »» attemptCount integer(int32) false none none
    »» created integer(int64) false none none
    »» expire integer(int64) false none none
    »» number string false none none
    »» otpId string false none none
    »» otpStatus string false none none
    »» referenceId string false none none
    »» timestampCreated string false none none
    »» timestampExpire string false none none

    Status Code 204

    Name Type Required Restrictions Description
    anonymous [OtpStatusEntity] false none none
    » Otp Status OtpStatusEntity false none none
    »» accountId string false none none
    »» applicationId string false none none
    »» attemptCount integer(int32) false none none
    »» created integer(int64) false none none
    »» expire integer(int64) false none none
    »» number string false none none
    »» otpId string false none none
    »» otpStatus string false none none
    »» referenceId string false none none
    »» timestampCreated string false none none
    »» timestampExpire string false none none

    Sends OTP for a number

    Code samples

    # You can also use wget
    curl -X POST https://api.tyntec.com/2fa/v1/otp?number=string \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/2fa/v1/otp?number=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp',
      method: 'post',
      data: '?number=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp?number=string',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/2fa/v1/otp',
      params: {
      'number' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/2fa/v1/otp', params={
      'number': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp?number=string");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/2fa/v1/otp", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /2fa/v1/otp

    Send an OTP based on your application configuration. Modify the request based on the optional parameters.

    Parameters

    Name In Type Required Description
    number query string true The number you want to use in E164 format
    applicationId query string false The UUID of the application you want to use. If not specified, the default will be used.
    via query string false SMS/VOICE/AUTO. The channel to deliver the OTP
    country query string false Optional if you provided a number without country code, it will add automatically. If the country code is included but doesn't match the country specified, it will result to an error
    language query string false The language template to be used in ISO 639-1 codes. If not specified it will auto detect based on number.If a language template does not exist, it will default to english
    text query string false Text to override the default template. Placeholder {{OTP}} must exist for auto generation of OTP, otherwise otpCode should be specified
    referenceId query string false Set your custom reference ID
    otpCode query string false Override the auto generated OTP code
    sender query string false Override the applications sender
    caller query string false Override the applicaitons caller
    pinLength query string false Override the pin length setting of the application

    Example responses

    200 Response

    {
      "accountId": "string",
      "applicationId": "string",
      "attemptCount": 0,
      "created": 0,
      "expire": 0,
      "number": "string",
      "otpId": "string",
      "otpStatus": "string",
      "referenceId": "string",
      "timestampCreated": "string",
      "timestampExpire": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The result of the OTP with a unique ID OtpStatusEntity
    201 Created Created None
    400 Bad Request Invalid parameters provided. Look at the response for the specific error ErrorResponse
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Not Found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Returns the status for this OTP

    Code samples

    # You can also use wget
    curl -X GET https://api.tyntec.com/2fa/v1/otp/{otpId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/2fa/v1/otp/{otpId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp/{otpId}',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp/{otpId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/2fa/v1/otp/{otpId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/2fa/v1/otp/{otpId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp/{otpId}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/2fa/v1/otp/{otpId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /2fa/v1/otp/{otpId}

    Parameters

    Name In Type Required Description
    otpId path string true otpId

    Example responses

    200 Response

    {
      "accountId": "string",
      "applicationId": "string",
      "attemptCount": 0,
      "created": 0,
      "expire": 0,
      "number": "string",
      "otpId": "string",
      "otpStatus": "string",
      "referenceId": "string",
      "timestampCreated": "string",
      "timestampExpire": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The OTP status OtpStatusEntity
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found OTP code not found ErrorResponse
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Resend an OTP

    Code samples

    # You can also use wget
    curl -X POST https://api.tyntec.com/2fa/v1/otp/{otpId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/2fa/v1/otp/{otpId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp/{otpId}',
      method: 'post',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp/{otpId}',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/2fa/v1/otp/{otpId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/2fa/v1/otp/{otpId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp/{otpId}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/2fa/v1/otp/{otpId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /2fa/v1/otp/{otpId}

    The same OTP code will be delivered as the original one if the OTP is still valid

    Parameters

    Name In Type Required Description
    otpId path string true otpId
    via query string false via
    sender query string false Override the applications sender
    caller query string false Override the applicaitons caller

    Example responses

    200 Response

    {
      "accountId": "string",
      "applicationId": "string",
      "attemptCount": 0,
      "created": 0,
      "expire": 0,
      "number": "string",
      "otpId": "string",
      "otpStatus": "string",
      "referenceId": "string",
      "timestampCreated": "string",
      "timestampExpire": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OTP resend OtpStatusEntity
    201 Created Created None
    400 Bad Request Not valid parameter provided ErrorResponse
    401 Unauthorized OTP is not valid anymore ErrorResponse
    403 Forbidden Forbidden None
    404 Not Found OTP not found ErrorResponse
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Delete an OTP

    Code samples

    # You can also use wget
    curl -X DELETE https://api.tyntec.com/2fa/v1/otp/{otpId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    DELETE https://api.tyntec.com/2fa/v1/otp/{otpId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp/{otpId}',
      method: 'delete',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp/{otpId}',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.tyntec.com/2fa/v1/otp/{otpId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.delete('https://api.tyntec.com/2fa/v1/otp/{otpId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp/{otpId}");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("DELETE");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.tyntec.com/2fa/v1/otp/{otpId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    DELETE /2fa/v1/otp/{otpId}

    Parameters

    Name In Type Required Description
    otpId path string true otpId

    Example responses

    200 Response

    {
      "accountId": "string",
      "applicationId": "string",
      "attemptCount": 0,
      "created": 0,
      "expire": 0,
      "number": "string",
      "otpId": "string",
      "otpStatus": "string",
      "referenceId": "string",
      "timestampCreated": "string",
      "timestampExpire": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OTP deleted OtpStatusEntity
    204 No Content No Content None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found OTP not found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Returns the status events for this OTP

    Code samples

    # You can also use wget
    curl -X GET https://api.tyntec.com/2fa/v1/otp/{otpId}/events \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/2fa/v1/otp/{otpId}/events HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp/{otpId}/events',
      method: 'get',
    
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp/{otpId}/events',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/2fa/v1/otp/{otpId}/events',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/2fa/v1/otp/{otpId}/events', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp/{otpId}/events");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("GET");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/2fa/v1/otp/{otpId}/events", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    GET /2fa/v1/otp/{otpId}/events

    Parameters

    Name In Type Required Description
    otpId path string true otpId

    Example responses

    200 Response

    [
      {
        "created": 0,
        "status": "string",
        "statusText": "string",
        "timestampCreated": "string",
        "type": "string"
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The OTP status Inline
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found OTP code not found ErrorResponse
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Response Schema

    Status Code 200

    Name Type Required Restrictions Description
    anonymous [StatusEvent] false none none
    » created integer(int64) false none none
    » status string false none none
    » statusText string false none none
    » timestampCreated string false none none
    » type string false none none

    Check an OTP

    Code samples

    # You can also use wget
    curl -X POST https://api.tyntec.com/2fa/v1/otp/{otpId}/check?otpCode=string \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/2fa/v1/otp/{otpId}/check?otpCode=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    var headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    $.ajax({
      url: 'https://api.tyntec.com/2fa/v1/otp/{otpId}/check',
      method: 'post',
      data: '?otpCode=string',
      headers: headers,
      success: function(data) {
        console.log(JSON.stringify(data));
      }
    })
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/2fa/v1/otp/{otpId}/check?otpCode=string',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.post 'https://api.tyntec.com/2fa/v1/otp/{otpId}/check',
      params: {
      'otpCode' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apiKey': 'API_KEY'
    }
    
    r = requests.post('https://api.tyntec.com/2fa/v1/otp/{otpId}/check', params={
      'otpCode': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    URL obj = new URL("https://api.tyntec.com/2fa/v1/otp/{otpId}/check?otpCode=string");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("POST");
    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(
        new InputStreamReader(con.getInputStream()));
    String inputLine;
    StringBuffer response = new StringBuffer();
    while ((inputLine = in.readLine()) != null) {
        response.append(inputLine);
    }
    in.close();
    System.out.println(response.toString());
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apiKey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/2fa/v1/otp/{otpId}/check", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    

    POST /2fa/v1/otp/{otpId}/check

    Provide the OTP that you received to validate it

    Parameters

    Name In Type Required Description
    otpId path string true otpId
    otpCode query string true otpCode

    Example responses

    200 Response

    {
      "accountId": "string",
      "applicationId": "string",
      "attemptCount": 0,
      "created": 0,
      "expire": 0,
      "number": "string",
      "otpId": "string",
      "otpStatus": "string",
      "referenceId": "string",
      "timestampCreated": "string",
      "timestampExpire": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK OtpStatusEntity
    201 Created Created None
    202 Accepted OTP provided is valid OtpStatusEntity
    401 Unauthorized OTP code provided is not valid OtpStatusEntity
    403 Forbidden OTP has been expired of too many attempts already OtpStatusEntity
    404 Not Found OTP not found None
    410 Gone OTP is not active anymore OtpStatusEntity
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Schemas

    OtpStatusEntity

    {
      "accountId": "string",
      "applicationId": "string",
      "attemptCount": 0,
      "created": 0,
      "expire": 0,
      "number": "string",
      "otpId": "string",
      "otpStatus": "string",
      "referenceId": "string",
      "timestampCreated": "string",
      "timestampExpire": "string"
    }
    
    

    Otp Status

    Properties

    Name Type Required Restrictions Description
    accountId string false none none
    applicationId string false none none
    attemptCount integer(int32) false none none
    created integer(int64) false none none
    expire integer(int64) false none none
    number string false none none
    otpId string false none none
    otpStatus string false none none
    referenceId string false none none
    timestampCreated string false none none
    timestampExpire string false none none

    StatusEvent

    {
      "created": 0,
      "status": "string",
      "statusText": "string",
      "timestampCreated": "string",
      "type": "string"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    created integer(int64) false none none
    status string false none none
    statusText string false none none
    timestampCreated string false none none
    type string false none none

    TwoFactorAuthApplicationEntity

    {
      "alphanumeric": false,
      "attempts": 3,
      "expire": 300,
      "name": "string",
      "pinLength": 4,
      "sender": "VERIFY",
      "caller": "VERIFY"
    }
    
    

    2FA applicaiton

    Properties

    Name Type Required Restrictions Description
    alphanumeric boolean false none If the OTP is alphanumeric or not
    attempts integer(int32) false none How many attempts the user can have for this OTP
    expire integer(int64) false none How many seconds until OTP expires
    name string false none Custom application name
    pinLength integer(int32) false none The length of a pin
    sender string false none The sender used for SMS delivery
    caller string false none The caller used for TTS delivery. Using a valid number will improve filtering issues caused by anonymous calls

    ErrorResponse

    {
      "code": "string",
      "id": "string",
      "message": "string",
      "timestamp": 0
    }
    
    

    ErrorResponse

    Properties

    Name Type Required Restrictions Description
    code string false none none
    id string false none none
    message string false none none
    timestamp integer(int64) false none none