API Reference
made for developers
Highlighted on page

    Introduction

    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

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

    Tipps for consuming the APIs

    In this section we would like to give you some tipps about consuming our APIs.

    Compatibility

    We work continuously on the APIs and products behind them to cover new uses cases, add new functionalities and add improvements suggested by you. During this process we strive for making these changes as less impactful as possible for your system.

    Speaking for the REST APIs we aim for changes that will not break your implementation, this covers

    • only adding new properties
    • sticking with the data types defined
    • not renaming existing ones.

    In order to make the communication between your system and ours as frictionless as possible we recommend to

    • follow strictly the data definitions when you send a request to us
    • accept unknown properties when receiving information from us.

    This recommendation follows the Robustness Principle

    2FA API

    Version : v1.0

    | Specification | Release Notes | Other versions |

    Two-factor authentication (2FA) is an additional security layer for your applications or your business. Traditional username/password approach is vulnerable, especially on the today's environment where everything is online. 2FA aims to increase the security level of a standard password-only approach.

    Base URLs:

    Application Service

    Users can create multiple 2FA applications and configurations through the 2FA API. tyntec stores these configurations so that users can select between own 2FA applications and the corresponding linked configuration. Those configuration will be used when delivering One Time Passwords (OTP).

    There is a default 2FA application for each user which contains default values and English language template. This default application will be used in case no 2FA application ID is specified in an OTP delivery request. Default 2FA application is configurable and users can set own default parameters or 2FA application.

    Returns all applications created.

    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/2fa/v1/application/", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

    GET /2fa/v1/application/

    Return a list of applications that have been created under your account

    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

    Create 2FA application

    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/2fa/v1/application/", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

    POST /2fa/v1/application/

    Creates a 2FA application instance. You can either:

    • Use the target URI with a POST HTTP request
    • Include the application parameters in your request body

    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

    Returns a 2FA application

    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/2fa/v1/application/{applicationId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    You can get a specific application by using the GET HTTP method and the application’s Universally Unique ID (UUID)

    Parameters
    Name In Type Required Description
    applicationId path string(UUID) true Application ID to be returned

    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 2FA application

    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("POST", "https://api.tyntec.com/2fa/v1/application/{applicationId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    Define the parameters that you would like to change in a 2FA application

    Parameters
    Name In Type Required Description
    applicationId path string true This parameter is part of the URI following the pattern ${baseURL}/application/{applicationId}. You can specify "default" to reference the default application
    name query string false This parameter represents the custom name for this application. “default” is not allowed, since it is reserved as it maps to the default application for this user.
    pinLength query integer(int32) false The length of the auto generated PIN length. PIN length can be between 4-11 digits.
    alphaNumeric query boolean false By default this parameter is FALSE, and the PIN is generated in numeric values. In case this parameter is TRUE then the auto-generated PIN will be a lower case alphanumeric PIN.
    attempts query integer(int32) false This parameter controls how many attempts the user is allowed to have in order to validate a delivered OTP.
    expire query integer(int64) false This parameter controls the expiration time in seconds after the first OTP delivery request.
    sender query string false This parameter is controlling the sender name upon SMS delivery.
    caller query string false This parameter is used to define a number as caller for voice calls. Adding this will improve the call success ratio, as some operators filters anonymous calls.
    deleteCaller query boolean false This parameter is used to delete an already defined caller for voice calls.

    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 2FA application

    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("DELETE", "https://api.tyntec.com/2fa/v1/application/{applicationId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    You can delete your application if needed by using the DELETE HTTP method. Existing OTPs will still be valid but resend or verification of an OTP will not be possible.

    Note You cannot delete the “default” application.

    Parameters
    Name In Type Required Description
    applicationId path string true applicationId to be deleted

    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/Update language template

    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("POST", "https://api.tyntec.com/2fa/v1/application/{applicationId}/language", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    You can add or edit a language template by referring to the application UUID resource and the language you want to add or edit. If you specify also the channel optional parameter, the specific template for this delivery channel will be created.

    Parameters
    Name In Type Required Description
    applicationId path string true The applicationId of the application you would like to edit. This parameter is part of the URI following the pattern ${baseURL}/application/{applicationId}. You can specify "default" to reference the default application
    language query string true The language locale should be in ISO 639-1 format
    text query string true The text template for the specific language. Placeholder {{OTP}} must exist at least once. {{SEC}} is an optional placeholder that will replace the “expire” parameter for this application.
    channel query string false This optional parameter is set in case you want to have different template for the same language, depending on the delivery channel, SMS or VOICE

    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 language template

    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("DELETE", "https://api.tyntec.com/2fa/v1/application/{applicationId}/language", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    You can delete a language template by referring to the application UUID resource and the language you want to delete. If you specify also the channel optional parameter, the specific template for this delivery channel will be deleted.

    Parameters
    Name In Type Required Description
    applicationId path string true This parameter is the applicationId of the application you would like to edit and it is part of the URI following the pattern ${baseURL}/application/{applicaitonId}. You can specify "default" to reference the default application
    language query string true The language locale should be in ISO 639-1 format
    channel query string false This optional parameter is set in case you want to have different template for the same language, depending on the delivery channel, SMS or VOICE

    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

    OTP Service

    The OTP service is used for delivering and checking One Time Password (OTP) codes to destination numbers.

    Get all OTPs

    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/2fa/v1/otp", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

    GET /2fa/v1/otp

    You can query the events endpoint of an OTP delivery instance to get back a list of events reported for this delivery.

    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

    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("POST", "https://api.tyntec.com/2fa/v1/otp", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

    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.
    language query string false The language template to be used in ISO 639-1 codes. If the template is not specified it will be auto detected 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
    Detailed descriptions

    country: 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

    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

    OTP 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/2fa/v1/otp/{otpId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    Returns the status of an OTP.

    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

    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)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    In case the end user didn’t receive the OTP in a reasonable timeframe you can use this operation to resend the same OTP code. The OTP code will be the same as the original one, but you have the option to choose a different delivery channel.

    Parameters
    Name In Type Required Description
    otpId path string true The OTP ID that the code should be resent
    via query string false You can force a delivery channel by using this parameter. Posible values are AUTO, SMS or VOICE. The default is “AUTO” which will use SMS in case of a mobile number and VOICE in case of a landline number.
    sender query string false In case you want to override the sender set in the application's configuration, you can specify a sender name for this OTP delivery
    caller query string false In case you want to override the caller set in the application's configuration, you can specify a caller id for this OTP delivery

    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 OTP

    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("DELETE", "https://api.tyntec.com/2fa/v1/otp/{otpId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    You can delete the status of an OTP by using this operation

    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

    OTP events 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/2fa/v1/otp/{otpId}/events", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    You can query the events endpoint of an OTP delivery instance to get back a list of events reported for this delivery.

    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

    OTP Validate

    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("POST", "https://api.tyntec.com/2fa/v1/otp/{otpId}/check", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # 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
    
    
    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());
    
    
    
    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);
    });
    
    
    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);
    });
    
    
    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()
    
    
    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)
    
    

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

    This operation will verify if the OTP code used matched the OTP code that was generated for this user. To verify an OTP code, you need to provide 1) the unique OTPId that refers the the OTP delivery request 2) the OTP code sent to the user

    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

    Chat API

    Version : v2.6

    | Specification | Release Notes | Postman Collection | Other versions |

    The Chat API 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.

    Notifications and messages from your users are send by us to your system via HTTP POST method.

    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/chat-api/v2/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/chat-api/v2/messages \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    POST https://api.tyntec.com/chat-api/v2/messages HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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 true The message you would like to send

    Example responses

    202 Response

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "acceptedAt": "2019-11-08T16:34:55Z"
    }
    

    400 Response

    {
      "status": 400,
      "violations": [
        {
          "field": "validate.request.whatsapp.contentType",
          "message": "must not be empty"
        }
      ],
      "title": "Constraint Violation"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    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
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    default Default Default response in case of any other error. Please check the error object for details 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/chat-api/v2/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/chat-api/v2/messages/{message-id} \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/messages/{message-id} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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"
      }
    }
    

    404 Response

    {
      "status": 404
    }
    

    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 Problem
    default Default Default response in case of any other error. Please check the error object for details 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/chat-api/v2/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/chat-api/v2/messages/{message-id}/history \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/messages/{message-id}/history HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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",
      "userContext": "my-message-reference",
      "history": [
        {
          "deliveryChannel": "whatsapp",
          "happendAt": "2019-03-13T12:57:27.048Z",
          "state": "accepted"
        }
      ]
    }
    

    404 Response

    {
      "status": 404
    }
    

    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 Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Receive messages

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

    We will use HTTP POST method to send the user messages to your system 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/chat-api/v2/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/chat-api/v2/media/{media-id} \
      -H 'Accept: audio/*' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/media/{media-id} HTTP/1.1
    Host: api.tyntec.com
    Accept: audio/*
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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

    404 Response

    {
      "status": 404
    }
    

    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 Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Notifications

    Notifications or DLRs are send to your system when

    • a message reaches a final state or
    • a message reaches an intermediate state and you opt-in to receive this
    • a user decides to delete a message previously send to you.
    • a user interacts with a group, such as joining or leaving the group

    We treat

    • delivered
    • seen / read
    • finally failed

    as final states for message send by you.

    All other states are treated as intermediate states.

    We will use HTTP POST method to send the notifications to your system.

    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/chat-api/v2/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/chat-api/v2/messages/{message-id}/status \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/messages/{message-id}/status HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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/chat-api/v2/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

    {
      "event": "MessageStatus::seen",
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "channel": "whatsapp",
      "status": "seen",
      "userContext": "my-message-reference",
      "timestamp": "2019-11-08T16:34:55.282Z",
      "from": 491672634678
    }
    

    404 Response

    {
      "status": 404
    }
    

    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 Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    WA Group management

    The WA Group management enables you to interact with WhatsApps Group API.

    It allows you to list all created groups, create, update and delete a group and generate invite links.

    The general flow for groups is

    1. Create a new group
    2. Update the details, eg. the group icon
    3. Get the invite link to the group
    4. Send the invite link to the users that should join your group
    5. Start interacting with the users in the group

    Note

    • When sending messages to the group you need to use the group id as to. Not the normal phone number of your user.
    • There are no limits on the number of groups you can create.

    Events genereated from groups are send out as a notification of type WhatsAppGroupEvent

    List groups

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups");
    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups', 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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/groups

    List all groups the phone number is member of

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.

    Example responses

    200 Response

    [
      {
        "groupId": "4923147790717-1564131378",
        "creationTime": 1564131378
      }
    ]
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Phone number unknown"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK List of group ids. Can be empty if no group exists WhatsAppGroups
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Create a new group

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X POST https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    POST https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups");
    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 = '{
      "subject": "This is a test group"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups',
    {
      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 = '{
      "subject": "This is a test group"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups', 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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /channels/whatsapp/phone-numbers/{phone-number}/groups

    Creates a new group with the given subject

    Body parameter

    {
      "subject": "This is a test group"
    }
    
    Parameters
    Name In Type Required Description
    body body WhatsAppGroupCreationRequest true Information in order to create the group
    phone-number path integer true Phone number used for WhatsApp messaging.

    Example responses

    200 Response

    {
      "groupId": "4923147790717-1564131378",
      "creationTime": 1564131378
    }
    

    400 Response

    {
      "status": 400,
      "violations": [
        {
          "field": "validate.request.whatsapp.contentType",
          "message": "must not be empty"
        }
      ],
      "title": "Constraint Violation"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Phone number unknown"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Group created WhatsAppGroupCreationResponse
    400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Get details about a group

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id} \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}

    Returns information about the group specified by the group id

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    200 Response

    {
      "admins": [
        4923147790717
      ],
      "creationTime": 1564131378,
      "creator": 4923147790717,
      "participants": [
        4923147790717,
        4923147790718
      ],
      "subject": "This is a test group"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Information about the group WhatsAppGroupDetails
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Get group participants

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants");
    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants', 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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants

    Returns current participants of a group

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    200 Response

    {
      "participants": [
        4923147790717,
        4923147790718
      ]
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK List of participants, can be empty WhatsAppGroupParticipants
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Remove participants from group

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X DELETE https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    DELETE https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants");
    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());
    
    
    const inputBody = '{
      "participants": [
        4923147790717,
        4923147790718
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants',
    {
      method: 'DELETE',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "participants": [
        4923147790717,
        4923147790718
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants',
    {
      method: 'DELETE',
      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/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.delete('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    DELETE /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants

    Removes all specified participants from the group.

    Body parameter

    {
      "participants": [
        4923147790717,
        4923147790718
      ]
    }
    
    Parameters
    Name In Type Required Description
    body body WhatsAppGroupParticipants true List of participants to be removed
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    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 Participants removed from group None
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Remove yourself from the group

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X DELETE https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    DELETE https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self HTTP/1.1
    Host: api.tyntec.com
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self");
    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());
    
    
    
    const headers = {
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.delete('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    DELETE /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/participants/self

    Removes the whatsapp account from it's own group.

    Note: The account can not rejoin the group afterwards

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    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 Participants removed from group None
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Get the group icon

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"image/png"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon \
      -H 'Accept: image/png' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon HTTP/1.1
    Host: api.tyntec.com
    Accept: image/png
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon");
    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':'image/png',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'image/png',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'image/png',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'image/png',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon

    Returns the current icon for the given group

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    200 Response

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 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 current icon string
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number, group id or icon does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Update the group icon

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"image/png"},
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PUT", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon \
      -H 'Content-Type: image/png' \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon HTTP/1.1
    Host: api.tyntec.com
    Content-Type: image/png
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    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 = 'string';
    const headers = {
      'Content-Type':'image/png',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    const inputBody = 'string';
    const headers = {
      'Content-Type':'image/png',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'image/png',
      'Accept': 'application/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.put('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'image/png',
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/icon

    Updates the group icon for the given group.

    The icon must have a minimal edge size of 192 pixel and must not exceed 5 MB in size

    Body parameter

    Parameters
    Name In Type Required Description
    body body string(binary) true Image that should be used as a group icon
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    400 Response

    {
      "status": 400,
      "violations": [
        {
          "field": "validate.request.whatsapp.contentType",
          "message": "must not be empty"
        }
      ],
      "title": "Constraint Violation"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    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
    202 Accepted Image successfully updated None
    400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Get the group profile

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile");
    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile', 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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile

    Retrieve the actual profile for the given group

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    200 Response

    {
      "subject": "This is a test group"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The current profile WhatsAppGroupProfile
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Update the group profile

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PUT", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    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 = '{
      "subject": "This is a test group"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "subject": "This is a test group"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile',
    {
      method: 'PUT',
      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/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.put('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/settings/profile

    Update the actual profile for the given group

    Body parameter

    {
      "subject": "This is a test group"
    }
    
    Parameters
    Name In Type Required Description
    body body WhatsAppGroupProfile true none
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    400 Response

    {
      "status": 400,
      "violations": [
        {
          "field": "validate.request.whatsapp.contentType",
          "message": "must not be empty"
        }
      ],
      "title": "Constraint Violation"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    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
    202 Accepted Profile successfully updated None
    400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    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("PUT", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
    {
      method: 'PUT',
    
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
    {
      method: 'PUT',
    
      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.put('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link

    Creates an invite link if necessary

    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    200 Response

    {
      "link": "https://chat.whatsapp.com/EVZpTCb8xmB1KSoZlyDgU1"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    
    Status Meaning Description Schema
    200 OK Invite link created WhatsAppGroupInviteLink
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link");
    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link', 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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link

    Get the current active invite link for the given group

    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    200 Response

    {
      "link": "https://chat.whatsapp.com/EVZpTCb8xmB1KSoZlyDgU1"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    
    Status Meaning Description Schema
    200 OK The current invite link WhatsAppGroupInviteLink
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("DELETE", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X DELETE https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    DELETE https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link HTTP/1.1
    Host: api.tyntec.com
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link");
    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());
    
    
    
    const headers = {
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
    {
      method: 'DELETE',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.delete('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.delete 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    DELETE /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/invites/link

    This operation invalidates the previously generated invite link

    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id

    Example responses

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Group id unknown"
    }
    

    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"
    }
    
    Status Meaning Description Schema
    200 OK The current invite link was deleted None
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number or group id does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    WA Settings management

    The WA Settings management enables you to change the following settings of your WhatsApp instance

    • logo
    • profile information

    Profile information consists of

    • company address
    • description
    • contact email
    • business category
    • websites
    • about

    Get the current profile

    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile");
    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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
    {
      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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile', 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/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/settings/profile

    Get the current profile settings

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.

    Example responses

    200 Response

    {
      "address": "Hofmannstrasse 25 - 27, 81379 Munich, Germany",
      "description": "tyntec WhatsApp Business API Demo",
      "email": "support@tyntec.com",
      "websites": [
        "https://www.tyntec.com",
        "https://api.tyntec.com/reference"
      ],
      "vertical": "Professional Services",
      "about": "Hey there! I am using WhatsApp."
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Phone number unknown"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The current profile settings WhatsAppProfile
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Update the profile

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PATCH", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X PATCH https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    PATCH https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PATCH");
    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 = '{
      "address": "Hofmannstrasse 25 - 27, 81379 Munich, Germany",
      "description": "tyntec WhatsApp Business API Demo",
      "email": "support@tyntec.com",
      "websites": [
        "https://www.tyntec.com",
        "https://api.tyntec.com/reference"
      ],
      "vertical": "Professional Services",
      "about": "Hey there! I am using WhatsApp."
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    const inputBody = '{
      "address": "Hofmannstrasse 25 - 27, 81379 Munich, Germany",
      "description": "tyntec WhatsApp Business API Demo",
      "email": "support@tyntec.com",
      "websites": [
        "https://www.tyntec.com",
        "https://api.tyntec.com/reference"
      ],
      "vertical": "Professional Services",
      "about": "Hey there! I am using WhatsApp."
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
    {
      method: 'PATCH',
      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/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.patch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.patch 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PATCH /channels/whatsapp/phone-numbers/{phone-number}/settings/profile

    Updates the WhatsApp client profile.

    Supports also selective updates.

    Removal of an information is done by setting its value to an empty string.

    Body parameter

    {
      "address": "Hofmannstrasse 25 - 27, 81379 Munich, Germany",
      "description": "tyntec WhatsApp Business API Demo",
      "email": "support@tyntec.com",
      "websites": [
        "https://www.tyntec.com",
        "https://api.tyntec.com/reference"
      ],
      "vertical": "Professional Services",
      "about": "Hey there! I am using WhatsApp."
    }
    
    Parameters
    Name In Type Required Description
    body body WhatsAppProfile true Information in order to create the group
    phone-number path integer true Phone number used for WhatsApp messaging.

    Example responses

    400 Response

    {
      "status": 400,
      "title": "Updating profile failed",
      "code": 1009
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Phone number unknown"
    }
    

    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
    204 No Content Profile updated None
    400 Bad Request Updating the whatsapp profile failed. In case a partial update failed please retrieve the current profile, change the required information and retry with the whole profile. Inline
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem
    Response Schema

    Status Code 400

    Name Type Required Restrictions Description
    » code string false none error code

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"image/png"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo \
      -H 'Accept: image/png' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo HTTP/1.1
    Host: api.tyntec.com
    Accept: image/png
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo");
    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':'image/png',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'image/png',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'image/png',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'image/png',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /channels/whatsapp/phone-numbers/{phone-number}/settings/logo

    Returns the current logo

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.

    Example responses

    200 Response

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Phone number unknown"
    }
    

    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 Current logo string
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"image/png"},
            "Accept": []string{"application/problem+json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("PUT", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo \
      -H 'Content-Type: image/png' \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo HTTP/1.1
    Host: api.tyntec.com
    Content-Type: image/png
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo");
    HttpURLConnection con = (HttpURLConnection) obj.openConnection();
    con.setRequestMethod("PUT");
    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 = 'string';
    const headers = {
      'Content-Type':'image/png',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    const inputBody = 'string';
    const headers = {
      'Content-Type':'image/png',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Content-Type': 'image/png',
      'Accept': 'application/problem+json',
      'apikey': 'API_KEY'
    }
    
    r = requests.put('https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'image/png',
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /channels/whatsapp/phone-numbers/{phone-number}/settings/logo

    Updates the logo

    The logo must have a minimal edge size of 500 pixel and must not exceed 5 MB in size.

    Recommended size is 640x640 pixel

    Body parameter

    Parameters
    Name In Type Required Description
    body body string(binary) true Image that should be used as a profile logo
    phone-number path integer true Phone number used for WhatsApp messaging.

    Example responses

    400 Response

    {
      "status": 400,
      "violations": [
        {
          "field": "validate.request.whatsapp.contentType",
          "message": "must not be empty"
        }
      ],
      "title": "Constraint Violation"
    }
    

    403 Response

    {
      "type": "https://httpstatuses.com/403",
      "title": "Forbidden",
      "status": 403
    }
    

    404 Response

    {
      "status": 404,
      "title": "Phone number unknown"
    }
    

    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
    204 No Content Logo successfully updated None
    400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
    403 Forbidden You attempting to use a number that is not assigned to your account Problem
    404 Not Found The phone number does not exists Problem
    default Default Default response in case of any other error. Please check the error object for details Problem

    Schemas

    MessageRequest

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

    The message you would like to send

    Properties

    Name Type Required Restrictions Description
    to string true none The receipient of the message. Could be one of - phone number in international format. In this it should follow the guidelines of E.164 but leading 00 is as well accepted - group id create via the WA Group management
    channels [string] true none Channels selected for delivery.
    overrides MessageRequestOverrides false none Overrides of defaults for this message
    context MessageRequestContext false none Contextual information for the message request
    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. Note The default content will be discontinued in a future release, please migrate to the channel specific properties whatsapp, sms and/or tyntecEcho
    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 [string] true none Channels selected for delivery.
    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.

    Note The default content will be discontinued in a future release, please migrate to the channel specific properties whatsapp, sms and/or tyntecEcho

    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 Media to be send
    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 true 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. Note This property will be removed in a future release. Please use text instead.
    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 phone number of 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. Note This property will be removed in a future release. Please switch to text with urlPreviewDisplayed set to true.
    media Media false none Media to be send
    template Template false none The message template to be send.
    location Location false none Location received or send
    urlPreviewDisplayed boolean false none Should a preview of the url be rendered. This will only have an effect on text messages.
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media
    contentType location

    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 Media to be send
    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"
    }
    
    

    Media to be send

    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
    type video

    Template

    {
      "templateId": "weclome_message",
      "language": {
        "policy": "deterministic",
        "example": "en"
      },
      "parameters": [
        {
          "default": "Peter"
        },
        {
          "default": "tyntec"
        }
      ]
    }
    
    

    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 Language settings for the template
    parameters [TemplateParameter] false none Parameter for replacement in the template.

    Language

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

    Language settings for the template

    Properties

    Name Type Required Restrictions Description
    policy string false none Used for multi-language template resolution. Note We got notified by WhatsApp that they will drop the fallback policy on template messages. As we need to stay up-to-date with the WhatsApp API, we will also drop this policy in the next month. Please switch to language policy deterministic.
    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"
    }
    
    

    Parameter for replacement in the template.

    The value can contain any character except of :

    • newline
    • tabulator
    • more then 4 consecutive spaces.

    It can be formatted accordingly to Formatting your messages.

    Properties

    Name Type Required Restrictions Description
    default string false none Variable substitution.

    Location

    {
      "longitude": 7.4954884,
      "latitude": 51.5005765,
      "name": "tyntec GmbH",
      "address": "tyntec GmbH, Semerteichstraße, Dortmund"
    }
    
    

    Location received or send

    Properties

    Name Type Required Restrictions Description
    longitude number(double) true none Longitude part of the coordinate
    latitude integer(double) true none Latitude part of the coordinate
    name string false none Optional name
    address string false none Optional address, will only be rendered if name is set

    MessageResponse

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "acceptedAt": "2019-11-08T16:34:55Z"
    }
    
    

    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

    APIEvent

    {
      "event": "MessageStatus::accepted",
      "channel": "sms",
      "from": 491672634678,
      "timestamp": "2019-11-08T16:34:55.281Z"
    }
    
    

    Basic type for events produced by the ChatAPI such as MessageStatus, InboundMessage and GroupEvent

    Properties

    Name Type Required Restrictions Description
    event string true none Determines which kind of event is sent
    channel string false none Channel which triggered the event. Can be empty in case of an internal source
    timestamp string(date-time) false none Point in time when the event happend
    from string false none Who triggered this event. Usually the phonenumber or whatsapp account id
    Enumerated Values
    Property Value
    event MessageStatus::accepted
    event MessageStatus::delivered
    event MessageStatus::seen
    event MessageStatus::failed
    event MessageStatus::channelFailed
    event MessageStatus::unknown
    event MessageStatus::deleted
    event MoMessage
    event WhatsAppGroupEvent::userJoined
    event WhatsAppGroupEvent::userLeft
    event WhatsAppGroupEvent::subjectChanged
    event WhatsAppGroupEvent::descriptionChanged
    channel sms
    channel whatsapp
    channel tyntecEcho

    MessageStatus

    {
      "event": "MessageStatus::seen",
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "channel": "whatsapp",
      "status": "seen",
      "userContext": "my-message-reference",
      "timestamp": "2019-11-08T16:34:55.282Z",
      "from": 491672634678
    }
    
    

    The current status of a message.

    It is used for messages send and received by you.

    In case you send a message the status will inform you about the delivery process.

    In the case that you receive a message from a user, the user may decide to delete the message. Then and only then status deleted is triggered.

    Properties

    Name Type Required Restrictions Description
    event string true none Determines which kind of event is sent.
    messageId string true none Global Message Id reference
    channel string false none Channel which triggered the event. Can be empty in case of an internal source
    deliveryChannel string false none Channel which was used for delivery. Note This property will be replaced in the future by the channel property from the APIEvent
    status string true none Indicates the status of the message. Be aware that not all channels support all status. Note This property will be replaced by the property event in a future release.
    timestamp string(date-time) true none Point in time when the event happend
    userContext string false none Contextual information set on the message request
    from string false none Who triggered this event. Usually the phonenumber or whatsapp account id
    details HistoryDetails false none Further information available for this event
    Enumerated Values
    Property Value
    event MessageStatus::accepted
    event MessageStatus::delivered
    event MessageStatus::seen
    event MessageStatus::failed
    event MessageStatus::unknown
    channel sms
    channel whatsapp
    channel tyntecEcho
    deliveryChannel sms
    deliveryChannel whatsapp
    deliveryChannel tyntecEcho
    status accepted
    status delivered
    status seen
    status failed
    status unknown

    MessageStatusChannelFailed

    {
      "event": "MessageStatus::channelFailed",
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "channel": "whatsapp",
      "status": "channelFailed",
      "userContext": "my-message-reference",
      "timestamp": "2019-11-08T16:34:55.282Z",
      "details": {
        "code": "whatsapp::error::noValidContact",
        "message": "No valid contact for msisdn +123234234"
      }
    }
    
    

    Indicates that a channel delivery has failed.

    This is an intermediate event. It might be followed by additional intermediate events. But finally the message status will reach one of the final states.

    Properties

    Name Type Required Restrictions Description
    event string true none Determines which kind of event is sent.
    messageId string true none Global Message Id reference
    channel string true none Channel which triggered the event. Can be empty in case of an internal source
    deliveryChannel string false none Channel which was used for delivery. Note This property will be replaced in the future by the channel property from the APIEvent
    status string false none Indicates the status of the message. Be aware that not all channels support all status. Note This property will be replaced by the property event in a future release.
    timestamp string(date-time) true none Point in time when the event happend
    userContext string false none Contextual information set on the message request
    details HistoryDetails true none Further information available for this event
    Enumerated Values
    Property Value
    event MessageStatus::channelFailed
    channel sms
    channel whatsapp
    channel tyntecEcho
    deliveryChannel sms
    deliveryChannel whatsapp
    deliveryChannel tyntecEcho
    status channelFailed

    MessageStatusDeletedEvent

    {
      "event": "MessageStatus::deleted",
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "channel": "whatsapp",
      "status": "deleted",
      "userContext": "my-message-reference",
      "timestamp": "2019-11-08T16:34:55.282Z",
      "from": 491672634678,
      "to": 4923147790813
    }
    
    

    Indicates that a previously send inbound MOMessage is deleted by the user.

    Properties

    Name Type Required Restrictions Description
    event string true none Determines which kind of event is sent.
    messageId string true none Global Message Id reference
    channel string true none Channel which triggered the event. Can be empty in case of an internal source.
    deliveryChannel string false none Channel which was used for delivery. Note This property will be replaced in the future by the channel property from the APIEvent.
    status string true none Indicates the status of the message. Be aware that not all channels support all status. Note This property will be replaced by the property event in a future release.
    timestamp string(date-time) true none Point in time when the event happend
    userContext string false none Contextual information set on the message request
    from string true none Who triggered this event. Usually the phonenumber or whatsapp account id.
    to string true none Which channel specific account id is the receiver of this event.
    Enumerated Values
    Property Value
    event MessageStatus::deleted
    channel sms
    channel whatsapp
    channel tyntecEcho
    deliveryChannel sms
    deliveryChannel whatsapp
    deliveryChannel tyntecEcho
    status deleted

    MessageHistory

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "userContext": "my-message-reference",
      "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
    userContext string false none Contextual information set on the message request
    history [HistoryItem] false none Ordered list of current available events for your message

    HistoryItem

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

    Contains information about a specific event occuring in the delivery process

    Properties

    Name Type Required Restrictions Description
    deliveryChannel string false none The channel triggering this event
    channel string false none The channel triggering this event
    happendAt string(date-time) false none When did the event happen
    state string false none State of the message delivery
    details HistoryDetails false none Further information available for this event
    Enumerated Values
    Property Value
    deliveryChannel sms
    deliveryChannel whatsapp
    deliveryChannel tyntecEcho
    channel sms
    channel whatsapp
    channel tyntecEcho
    state accepted
    state dispatched
    state dispatching_failed
    state success
    state failed
    state unknown

    HistoryDetails

    {
      "code": "tyntec::error:noFurtherChannelAvailable",
      "message": "No further channel after Channel[whatsapp] available",
      "from": 491672634678
    }
    
    

    Further information available for this event

    Properties

    Name Type Required Restrictions Description
    code string false none Code specific to the details
    message string false none Textual representation of the code, containing further information
    from string false none Who triggered this event. Usually the phonenumber or whatsapp account id

    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",
      "event": "MoMessage",
      "from": "49123512314",
      "timestamp": "2019-11-08T16:34:55.283Z",
      "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
          }
        ]
      }
    }
    
    

    Message received by us and delivered to your system via a webhook provided by your system.

    MoMessages are transferred by using HTTP POST method.

    Properties

    Name Type Required Restrictions Description
    event string true none Determines which kind of event is sent. Is always MoMessage
    channel string true none Channel which triggered the event.
    receivedAt string(date-time) false none Point in time when the message was received. Note This property will be replaced in the future by the timestamp property from the APIEvent
    timestamp string(date-time) false none Point in time when the message was received
    messageId string true none Message Id reference
    from string true none the sender of the message
    to string false none Receiving account of the message. The format is channel specific
    groupId string false none Group id from which the event originates from. Only present if the message was send into a group
    content MoContent true none Content of the mobile originated message
    context MoContext false none Contextual information of the mobile originated message
    sms SMS false none specifics of the sms channel
    whatsapp Whatsapp false none specifics of the whatsapp channel
    Enumerated Values
    Property Value
    event MoMessage
    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"
      }
    }
    
    

    Content of the mobile originated message

    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 Media information
    location Location false none Location received or send
    Enumerated Values
    Property Value
    contentType text
    contentType url
    contentType media
    contentType location

    MoContext

    {
      "messageId": "77185196-664a-43ec-b14a-fe97036c697a"
    }
    
    

    Contextual information of the mobile originated message

    Properties

    Name Type Required Restrictions Description
    messageId string false none The message id the MoMessage refers to. Usualy set when the sender replies to a specific message

    MoMedia

    {
      "type": "audio",
      "url": "https://api.tyntec.com/messaging/v1/chat/media/77185196-664a-43ec-b14a-fe97036c697f",
      "mediaId": "77185196-664a-43ec-b14a-fe97036c697f",
      "caption": "This is an picture of my cat!"
    }
    
    

    Media information

    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
    caption string false none caption specified by the user or the file name of the document
    Enumerated Values
    Property Value
    type image
    type document
    type audio
    type voice
    type video

    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 Origin Information of the message
    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"
    }
    
    

    Origin Information of the message

    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-11-08T16:34:55Z",
      "price": 0.1,
      "currency": "EUR",
      "priceEffective": "2019-11-08T16:34:55Z",
      "sequenceNumber": 1
    }
    
    

    SMS channel specific information

    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

    {
      "senderName": "Peter"
    }
    
    

    specifics of the whatsapp channel

    Properties

    Name Type Required Restrictions Description
    senderName string false none Name of the sender, set in his or her profile

    MessageRequestContext

    {
      "userContext": "my-message-reference"
    }
    
    

    Contextual information for the message request

    Properties

    Name Type Required Restrictions Description
    userContext string false none Contextual information that is transfered back on delivery notifications.

    MessageRequestOverrides

    {
      "notificationCallbackUrl": "https://en4u5fpprib5i.x.pipedream.net"
    }
    
    

    Overrides of defaults for this message

    Properties

    Name Type Required Restrictions Description
    notificationCallbackUrl string false none When present this url is used for sending the delivery notifications to your webhook. Can be used for debugging use cases or individual routings.

    WhatsAppGroupCreationRequest

    {
      "subject": "This is a test group"
    }
    
    

    Required information when creating a new group

    Properties

    Name Type Required Restrictions Description
    subject string true none Group subject, used as display name

    WhatsAppGroupCreationResponse

    {
      "groupId": "4923147790717-1564131378",
      "creationTime": 1564131378
    }
    
    

    Response after a group was successfully created

    Properties

    Name Type Required Restrictions Description
    groupId string false read-only The group id of the created group. This id is required on subsequent interactions with the group such as - changes of the profile - invite link management - sending a message to the group
    creationTime integer false read-only When was the group created. Time is given in seconds since 01.01.1970

    WhatsAppGroups

    [
      {
        "groupId": "4923147790717-1564131378",
        "creationTime": 1564131378
      }
    ]
    
    

    Properties

    Name Type Required Restrictions Description
    anonymous [WhatsAppGroup] false none [Basic information about a group]

    WhatsAppGroup

    {
      "groupId": "4923147790717-1564131378",
      "creationTime": 1564131378
    }
    
    

    Basic information about a group

    Properties

    Name Type Required Restrictions Description
    groupId string false read-only The group id of a group. This id is required on subsequent interactions with the group such as - changes of the profile - invite link management - sending a message to the group
    creationTime integer false read-only When was the group created. Time is given in seconds since 01.01.1970

    WhatsAppGroupDetails

    {
      "admins": [
        4923147790717
      ],
      "creationTime": 1564131378,
      "creator": 4923147790717,
      "participants": [
        4923147790717,
        4923147790718
      ],
      "subject": "This is a test group"
    }
    
    

    Information about a dedicated WhatsApp group

    Properties

    Name Type Required Restrictions Description
    admins [string] false read-only List of admin whatsapp account id
    creationTime integer false read-only When was the group created. Time is given in seconds since 01.01.1970
    creator string false read-only Which account created the group. Is always your WhatsApp account assigned to the phone number used
    participants [string] false read-only List of participants in the group
    subject string false read-only Group subject, used as display name

    WhatsAppGroupParticipants

    {
      "participants": [
        4923147790717,
        4923147790718
      ]
    }
    
    

    Participants of a whatsapp group

    Properties

    Name Type Required Restrictions Description
    participants [string] false none List of participants in the group

    WhatsAppGroupProfile

    {
      "subject": "This is a test group"
    }
    
    

    Profile of the WhatsApp group

    Properties

    Name Type Required Restrictions Description
    subject string true none Group subject, used as display name

    {
      "link": "https://chat.whatsapp.com/EVZpTCb8xmB1KSoZlyDgU1"
    }
    
    

    Invite link for the group.

    Needs to be send to all participants of the group either by template or normal text message

    Name Type Required Restrictions Description
    link string true read-only The invite link as URL

    WhatsAppGroupEvent

    {
      "event": "WhatsAppGroupEvent::userJoined",
      "channel": "whatsapp",
      "timestamp": "2019-11-08T16:34:55.288Z",
      "from": 491672634678,
      "operator": 491672634652,
      "groupId": "4923147790717-1564131378",
      "users": [
        491672634672,
        491672634673
      ]
    }
    
    

    This events are send out for WhatsApp groups your account is member of.

    The details of a certain event are stored in dedicated properties, please refer to the documentation below which eventType will fill which property.

    Properties

    Name Type Required Restrictions Description
    event string true none Determines which kind of event is sent.
    channel string false none Channel which triggered the event. Is always whatsapp
    timestamp string(date-time) false none Point in time when the event happend
    from string false none Who triggered this event. Usually the phonenumber or whatsapp account id
    operator string false none Phone number or whatsapp account id of the initiating user. May not be the same as from.
    groupId string true none originating group id
    subject string false none The changed subject of the group. Will only be present on subjectChanged
    description string false none The changed description of the group. Will only be present on descriptionChanged
    users [string] false none Accounts left or joined the group. Will only be present on userJoined or userLeft
    Enumerated Values
    Property Value
    event WhatsAppGroupEvent::userJoined
    event WhatsAppGroupEvent::userLeft
    event WhatsAppGroupEvent::subjectChanged
    event WhatsAppGroupEvent::descriptionChanged
    channel whatsapp

    WhatsAppProfile

    {
      "address": "Hofmannstrasse 25 - 27, 81379 Munich, Germany",
      "description": "tyntec WhatsApp Business API Demo",
      "email": "support@tyntec.com",
      "websites": [
        "https://www.tyntec.com",
        "https://api.tyntec.com/reference"
      ],
      "vertical": "Professional Services",
      "about": "Hey there! I am using WhatsApp."
    }
    
    

    Properties

    Name Type Required Restrictions Description
    address string false none Address of the business
    description string false none Brief introduction of the business
    email string false none Contact mail address
    websites [string] false none Websites of the business
    vertical string false none Industry of the business
    about string false none Text to display in your profile's About section
    Enumerated Values
    Property Value
    vertical Automotive
    vertical Beauty, Spa and Salon
    vertical Clothing and Apparel
    vertical Education
    vertical Entertainment
    vertical Event Planning and Service
    vertical Finance and Banking
    vertical Food and Grocery
    vertical Public Service
    vertical Hotel and Lodging
    vertical Medical and Health
    vertical Non-profit
    vertical Professional Services
    vertical Shopping and Retail
    vertical Travel and Transportation
    vertical Restaurant
    vertical Other

    NIS API

    Version : v1.0

    | Specification | Release Notes | Other versions |

    tyntec's Number Information Services (NIS)

    Base URLs:

    Global Number Portability

    tyntec's Global Number Portability (GNP) resolves number portability by obtaining data directly from local number portability databases and live network information from across the globe

    Get GNP information

    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/nis/v1/gnp", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/nis/v1/gnp?msisdn=49569858597 \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/nis/v1/gnp?msisdn=49569858597 HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/nis/v1/gnp?msisdn=49569858597");
    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/nis/v1/gnp?msisdn=49569858597',
    {
      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/nis/v1/gnp?msisdn=49569858597',
    {
      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/nis/v1/gnp', params={
      'msisdn': '49569858597'
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/nis/v1/gnp',
      params: {
      'msisdn' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /gnp

    Global Number Portability (GNP) request for the specified msisdn

    Parameters
    Name In Type Required Description
    msisdn query string true The phone number of interest, given in international format
    callbackUrl query string false The asynchronous response can be triggered with this request parameter. In this case, tyntec's application will POST the requested number information to your webserver at the given URL, instead of the default synchronous response given in the body of the "HTTP 200 OK" response. If your server does not answer "HTTP 200 OK" within two seconds, tyntec's application will retry for a maximum of 48 hours to POST the number information after 1, 5, 10, 20, 30, 60 minutes
    Detailed descriptions

    msisdn: The phone number of interest, given in international format

    callbackUrl: The asynchronous response can be triggered with this request parameter. In this case, tyntec's application will POST the requested number information to your webserver at the given URL, instead of the default synchronous response given in the body of the "HTTP 200 OK" response. If your server does not answer "HTTP 200 OK" within two seconds, tyntec's application will retry for a maximum of 48 hours to POST the number information after 1, 5, 10, 20, 30, 60 minutes

    Example responses

    200 Response

    {
      "requestId": "12-86cfafba-8677-f42b-5050-ece6af6abf01",
      "msisdn": "+491622943176",
      "ported": "false",
      "price": "0.001",
      "currency": "EUR",
      "priceEffective": "2010-11-01T00:00:00+0000",
      "errorCode": "0",
      "mcc": "262",
      "mnc": "02",
      "ttid": "15",
      "operator": "Vodafone",
      "country": "DEU",
      "timezone": "+0100",
      "technology": "GSM",
      "synchronous": "true"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Successful GNP response. In case a valid callbackUrl is provided, the response will be the requestId. GnpResponse
    400 Bad Request Error in msisdn or in callback Url Problem
    401 Unauthorized Invalid account credentials Problem
    402 Payment Required The current credit balance is not sufficient for this request Problem
    403 Forbidden Authorization information is missing Problem
    500 Internal Server Error Something went wrong :-( Problem

    Global Number Verification

    tyntec's Global Number Verification (GNV) minimizes message loss and unsuccessful call attempts with real-time phone number verification, providing key information on a user's phone number, such as subscriber status and roaming data

    Get GNV information

    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/nis/v1/gnv", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X GET https://api.tyntec.com/nis/v1/gnv?msisdn=49569858597 \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/nis/v1/gnv?msisdn=49569858597 HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/nis/v1/gnv?msisdn=49569858597");
    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/nis/v1/gnv?msisdn=49569858597',
    {
      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/nis/v1/gnv?msisdn=49569858597',
    {
      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/nis/v1/gnv', params={
      'msisdn': '49569858597'
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json',
      'apiKey' => 'API_KEY'
    }
    
    result = RestClient.get 'https://api.tyntec.com/nis/v1/gnv',
      params: {
      'msisdn' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /gnv

    Global Number Verification (GNV) request for the specified msisdn

    Parameters
    Name In Type Required Description
    msisdn query string true The phone number of interest, given in international format
    callbackUrl query string false The asynchronous response can be triggered with this request parameter. In this case, tyntec's application will POST the requested number information to your webserver at the given URL, instead of the default synchronous response given in the body of the "HTTP 200 OK" response. If your server does not answer "HTTP 200 OK" within two seconds, tyntec's application will retry for a maximum of 48 hours to POST the number information after 1, 5, 10, 20, 30, 60 minutes
    Detailed descriptions

    msisdn: The phone number of interest, given in international format

    callbackUrl: The asynchronous response can be triggered with this request parameter. In this case, tyntec's application will POST the requested number information to your webserver at the given URL, instead of the default synchronous response given in the body of the "HTTP 200 OK" response. If your server does not answer "HTTP 200 OK" within two seconds, tyntec's application will retry for a maximum of 48 hours to POST the number information after 1, 5, 10, 20, 30, 60 minutes

    Example responses

    200 Response

    {
      "requestId": "12-86cfafba-8677-f42b-5050-ece6af6abf01",
      "msisdn": "+491622943176",
      "ported": "false",
      "roaming": "false",
      "presence": "true",
      "price": 0.001,
      "currency": "EUR",
      "priceEffective": "2010-11-01T00:00:00+0000",
      "errorCode": "0",
      "nrhMCC": "262",
      "nrhMNC": "02",
      "nrhTtId": "15",
      "nrhOperator": "Vodafone",
      "nrhCountry": "DEU",
      "nrhTimeZone": "+0100",
      "nrhTechnology": "GSM",
      "imsiMCC": "262",
      "imsiMNC": "02",
      "imsi": "string",
      "imsiTtId": "15",
      "imsiOperator": "Vodafone",
      "imsiCountry": "DEU",
      "imsiTimeZone": "+0100",
      "imsiTechnology": "GSM",
      "hlrCC": "49",
      "hlrNDC": "162",
      "hlrMCC": "262",
      "hlrMNC": "02",
      "hlr": "string",
      "hlrTtId": "15",
      "hlrOperator": "Vodafone",
      "hlrCountry": "DEU",
      "hlrTimeZone": "+0100",
      "hlrTechnology": "GSM",
      "mscCC": "49",
      "mscNDC": "162",
      "mscMCC": "262",
      "mscMNC": "02",
      "msc": "string",
      "mscTtId": "15",
      "mscOperator": "Vodafone",
      "mscCountry": "DEU",
      "mscTimeZone": "+0100",
      "mscTechnology": "GSM",
      "synchronous": "true"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Successful GNV response GnvResponse
    400 Bad Request Error in msisdn or in callback Url Problem
    401 Unauthorized Invalid account credentials Problem
    402 Payment Required The current credit balance is not sufficient for this request Problem
    403 Forbidden Authorization information is missing Problem
    500 Internal Server Error Something went wrong :-( Problem

    Schemas

    GnpResponse

    {
      "requestId": "12-86cfafba-8677-f42b-5050-ece6af6abf01",
      "msisdn": "+491622943176",
      "ported": "false",
      "price": "0.001",
      "currency": "EUR",
      "priceEffective": "2010-11-01T00:00:00+0000",
      "errorCode": "0",
      "mcc": "262",
      "mnc": "02",
      "ttid": "15",
      "operator": "Vodafone",
      "country": "DEU",
      "timezone": "+0100",
      "technology": "GSM",
      "synchronous": "true"
    }
    
    

    The number information response for GNP

    Properties

    Name Type Required Restrictions Description
    requestId string false none The unique identifier provided for each request
    msisdn string false none The phone number of interest given in international format
    ported string false none An indication of the porting status (yes/no)
    price number false none The price for the query
    currency string false none The currency in which the pricing is given; corresponding to the currency of the invoice
    priceEffective string false none The date when "price" became effective
    errorCode string false none The reason for an unsuccessful attempt
    mcc string false none A representative MCC (Mobile Country Code) of the operator
    mnc string false none A representative MNC (Mobile Network Code) of the operator
    ttid string false none The respective tyntec ID of the network
    operator string false none The human readable name of the operator
    country string false none The three-letter country code(following ISO 3166-1 alpha-3) where the operator is located
    timezone string false none The operator's local time zone relative to UTC
    technology string false none Technology used by the operator's network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed
    synchronous boolean false none Indicates whether the response body contains the number information(synchronous) or just the requestId of the asynchronous response

    GnvResponse

    {
      "requestId": "12-86cfafba-8677-f42b-5050-ece6af6abf01",
      "msisdn": "+491622943176",
      "ported": "false",
      "roaming": "false",
      "presence": "true",
      "price": 0.001,
      "currency": "EUR",
      "priceEffective": "2010-11-01T00:00:00+0000",
      "errorCode": "0",
      "nrhMCC": "262",
      "nrhMNC": "02",
      "nrhTtId": "15",
      "nrhOperator": "Vodafone",
      "nrhCountry": "DEU",
      "nrhTimeZone": "+0100",
      "nrhTechnology": "GSM",
      "imsiMCC": "262",
      "imsiMNC": "02",
      "imsi": "string",
      "imsiTtId": "15",
      "imsiOperator": "Vodafone",
      "imsiCountry": "DEU",
      "imsiTimeZone": "+0100",
      "imsiTechnology": "GSM",
      "hlrCC": "49",
      "hlrNDC": "162",
      "hlrMCC": "262",
      "hlrMNC": "02",
      "hlr": "string",
      "hlrTtId": "15",
      "hlrOperator": "Vodafone",
      "hlrCountry": "DEU",
      "hlrTimeZone": "+0100",
      "hlrTechnology": "GSM",
      "mscCC": "49",
      "mscNDC": "162",
      "mscMCC": "262",
      "mscMNC": "02",
      "msc": "string",
      "mscTtId": "15",
      "mscOperator": "Vodafone",
      "mscCountry": "DEU",
      "mscTimeZone": "+0100",
      "mscTechnology": "GSM",
      "synchronous": "true"
    }
    
    

    The number information response for GNV

    Properties

    Name Type Required Restrictions Description
    requestId string false none The unique identifier provided for each request
    msisdn string false none The phone number of interest given in international format
    ported string false none Indicating the porting status true/false/unknown
    roaming string false none Indicating the roaming status true/false/unknown
    presence string false none Latest handset status (switched on/off) known by the operator (stored in respective HLR)
    price number false none The price for the query
    currency string false none The currency in which the pricing is given; corresponding to the currency of the invoice
    priceEffective string false none The date when "price" became effective
    errorCode string false none The reason for an unsuccessful attempt
    nrhMCC string false none A representative MCC (Mobile Country Code) of the NRH's network (Number Range Holder)
    nrhMNC string false none A representative MNCs (Mobile Network Codes) of the NRH's network
    nrhTtId string false none The respective tyntec ID of the NRH
    nrhOperator string false none Human readable name of the NRH
    nrhCountry string false none The three-letter country code(following ISO 3166-1 alpha-3) where the NRH's network is located
    nrhTimeZone string false none Local time zone of NRH's network relative to UTC
    nrhTechnology string false none The technology used by NRH operator's network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed
    imsiMCC string false none The MCC of the subscriber's IMSI (International Mobile Subscriber Identity)
    imsiMNC string false none The MNC of the subscriber's IMSI
    imsi string false none none
    imsiTtId string false none The respective tyntec ID of the subscription network operator
    imsiOperator string false none Human readable name of the subscription network operator
    imsiCountry string false none The three-letter country code where the subscription network is located
    imsiTimeZone string false none Local time zone of the subscription network relative to UTC
    imsiTechnology string false none The technology used by the subscription network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed
    hlrCC string false none The CC (Country Code) of the responding HLR (Home Location Register)
    hlrNDC string false none The NDC (National Dialling Code) of the responding HLR
    hlrMCC string false none A representative MCC of the HLR's operator
    hlrMNC string false none A representative MNC of the HLR's operator
    hlr string false none none
    hlrTtId string false none The respective tyntec ID of the operator's HLR
    hlrOperator string false none Human readable name of operator's HLR
    hlrCountry string false none The three-letter country code where the HLR is located
    hlrTimeZone string false none Local time zone of the HLR relative to UTC. +HH:mm (according to ISO 8601)
    hlrTechnology string false none The technology used by the HLR operator network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed
    mscCC string false none The CC of the MSC (Mobile Switching Center)
    mscNDC string false none The MSC of the NDC
    mscMCC string false none A representative MCC of the operator's MSC
    mscMNC string false none A representative MNC of the operator's MSC
    msc string false none none
    mscTtId string false none The respective tyntec ID of the operator's MSC
    mscOperator string false none Human readable name of operator's MSC
    mscCountry string false none The three-letter country code(following ISO 3166-1 alpha-3) of the network operating the MSC
    mscTimeZone string false none Local time zone of the MSC relative to UTC. +HH:mm (according to ISO 8601)
    mscTechnology string false none The technology used by the MSC operator's network. Possible values are: GSM, MVNO GSM, GSM/CDMA, Satellite, CDMA, iDen, iDen/GSM, Pager, Fixed
    synchronous boolean false none Indicates whether the response body contains the number information(synchronous) or just the requestId of the asynchronous response

    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.

    Messaging API

    Version : v1.0

    | Specification | Release Notes | Other versions |

    The Messaging API enables you to sent messages to your customers or to receive messages from your customers to phone numbers registered with tyntec.

    Base URLs:

    Send SMS

    tyntec’s sending SMS service is governed by two operations that allow you:

    • to send an SMS and
    • to query the status of a previously sent SMS

    tyntec stores the status details for up to three months after the final delivery state is known.

    Sends SMS via POST HTTP method

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/messaging/v1/sms", 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/sms?from=string&message=string \
      -H 'Accept: application/json'
    
    
    POST https://api.tyntec.com/messaging/v1/sms?from=string&message=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/sms?from=string&message=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());
    
    
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/sms?from=string&message=string',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/sms?from=string&message=string',
    {
      method: 'POST',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.post('https://api.tyntec.com/messaging/v1/sms', params={
      'from': 'string',  'message': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.post 'https://api.tyntec.com/messaging/v1/sms',
      params: {
      'from' => 'string',
    'message' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /messaging/v1/sms

    Parameters
    Name In Type Required Description
    to query string false Destination phone number in international phone format E.164
    from query string true This parameter gives the identification of the sending party, which can either be the phone number in international format or an alphanumeric identifier with up to 11 characters.
    message query string true The message will be sent with characters encoded either in GSM standard alphabet (GSM-7) or GSM Unicode alphabet (UCS-2).
    encoding query string false Encoding selection between GSM7, UNICODE or the default AUTO selection
    gateway query string false Which gateway to use for the delivery of the message
    conversion query boolean false Is this message subject to conversion ratio
    sendDateTime query string false Any future date in the format “yyyy-MM-ddT-HH:mm:ss+HH:mm” ISO 8601. If not set, message will be sent immediately. The default time zone is UTC
    validity query string false Validity in minutes for this message
    reference query string false A customer reference attached to the Delivery Reports
    callbackUrl query string false Your URL for delivering the Delivery Reports. Leave empty for no Delivery Report
    callbackMethod query string false Your prefered HTTP method for the Delivery Report callback. Possible values POST/GET
    partLimit query integer(int32) false Up to how many parts you allow this message to be concatenated
    trate query number(double) false Controls the transcoding rate of the original message to GSM-7 compatible characters. This can be used to compress the message.
    mrate query number(double) false Controls the replacement rate of characters incompatible with GSM-7. They're replaced with '.'.
    upperCased query boolean false If you allow the transcoder to try an upper case version of the content in case this improves the produced parts of the message
    keepEmojis query boolean false Instructs the transcoder to keep emojis or to replace the with text. By default the transcoder will keep emojis; thus text will result to UNICODE.
    flash query boolean false If this sms will be delivered as flash. Some networks do not support this.
    Detailed descriptions

    from: This parameter gives the identification of the sending party, which can either be the phone number in international format or an alphanumeric identifier with up to 11 characters.

    Some destination networks impose restrictions on the sender ID format. Please check the coverage list and contact us for more information.

    message: The message will be sent with characters encoded either in GSM standard alphabet (GSM-7) or GSM Unicode alphabet (UCS-2).

    • GSM standard alphabet GSM-7. Maximum length is 160 characters per single message and 153 characters per concatenated message.
    • GSM Unicode alphabet UCS-2. Maximum length is 70 characters per single message and 66 characters per concatenated message.

    tyntec automatically splits the sent message into concatenated messages if the message exceeds the given limits. These concatenated messages are unified by the handset once again and they are displayed as one message (if supported by the handset).

    tyntec will charge for each part of the concatenated message as an individual message.

    Enumerated Values
    Parameter Value
    encoding AUTO
    encoding GSM7
    encoding UNICODE

    Example responses

    200 Response

    {
      "doneDate": "string",
      "errorCode": "string",
      "errorReason": "string",
      "from": "+49123456789",
      "href": "string",
      "mccmnc": "string",
      "parts": [
        {
          "currency": "EUR",
          "deliveryState": "string",
          "doneDate": "string",
          "errorCode": "string",
          "partId": "string",
          "price": -0.005,
          "priceEffective": "2018-06-01T00:00:00+0200",
          "sentDate": "2019-07-02T16:47:39+0200",
          "statusText": "string"
        }
      ],
      "priceEffective": "2019-11-08T16:34:56Z",
      "reference": "string",
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "sentDate": "2019-07-02T16:47:39+0200",
      "size": 1,
      "status": 400,
      "submitDate": "2019-11-08T16:34:56Z",
      "to": "+1987654321",
      "ttid": 77292
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The messageIds of your request RestMessageResponse
    201 Created Created None
    400 Bad Request Invalid request Problem
    401 Unauthorized Unauthorized Problem
    403 Forbidden Forbidden Problem
    404 Not Found Not Found Problem
    500 Internal Server Error Something went wrong :-( Problem

    Sends SMS via GET HTTP method

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/messaging/v1/sms", 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/sms?to=string&from=string&message=string \
      -H 'Accept: application/json'
    
    
    GET https://api.tyntec.com/messaging/v1/sms?to=string&from=string&message=string HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/sms?to=string&from=string&message=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());
    
    
    
    const headers = {
      'Accept':'application/json'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/sms?to=string&from=string&message=string',
    {
      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'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/sms?to=string&from=string&message=string',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.tyntec.com/messaging/v1/sms', params={
      'to': 'string',  'from': 'string',  'message': 'string'
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.tyntec.com/messaging/v1/sms',
      params: {
      'to' => 'string',
    'from' => 'string',
    'message' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /messaging/v1/sms

    Parameters
    Name In Type Required Description
    to query string true This parameter represents the receiving party’s phone number in international phone format
    from query string true This parameter gives the identification of the sending party, which can either be the phone number in international format or an alphanumeric identifier with up to 11 characters.
    message query string true The message will be sent with characters encoded either in GSM standard alphabet (GSM-7) or GSM Unicode alphabet (UCS-2).
    encoding query string false Encoding selection between GSM7, UNICODE or the default AUTO selection
    gateway query string false Which gateway to use for the delivery of the message
    conversion query boolean false Is this message subject to conversion ratio
    sendDateTime query string false Any future date in the format “yyyy-MM-ddT-HH:mm:ss+HH:mm” ISO 8601. If not set, message will be sent immediately. The default time zone is UTC
    validity query string false Validity in minutes for this message
    reference query string false A custom reference that will mark the Delivery Report
    callbackUrl query string false Your URL for delivering the Delivery Reports. Leave empty for no Delivery Report
    callbackMethod query string false Your prefered HTTP method for the Delivery Report callback. Possible values POST/GET
    partLimit query integer(int32) false Up to how many parts you allow this message to be concatenated
    trate query number(double) false Up to how much you allow the transcoder to replace original characters to make it GSM-7 compatible. Possible decimal values from 0 to 1.
    mrate query number(double) false Up to how much you allow the transcoder to skip original characters to make it GSM-7 compatible. Possible decimal values from 0 to 1.
    upperCased query boolean false If you allow the transcoder to try an upper case version of the content in case this improves the produced parts of the message
    keepEmojis query boolean false Instructs the transcoder to keep emojis or to replace the with text. By default the transcoder will keep emojis; thus text will result to UNICODE.
    flash query boolean false If this sms will be delivered as flash. Some networks do not support this.
    Detailed descriptions

    from: This parameter gives the identification of the sending party, which can either be the phone number in international format or an alphanumeric identifier with up to 11 characters.

    Some destination networks impose restrictions on the sender ID format. Please check the coverage list and contact us for more information.

    message: The message will be sent with characters encoded either in GSM standard alphabet (GSM-7) or GSM Unicode alphabet (UCS-2).

    • GSM standard alphabet GSM-7. Maximum length is 160 characters per single message and 153 characters per concatenated message.
    • GSM Unicode alphabet UCS-2. Maximum length is 70 characters per single message and 66 characters per concatenated message.

    tyntec automatically splits the sent message into concatenated messages if the message exceeds the given limits. These concatenated messages are unified by the handset once again and they are displayed as one message (if supported by the handset).

    tyntec will charge for each part of the concatenated message as an individual message.

    Enumerated Values
    Parameter Value
    encoding AUTO
    encoding GSM7
    encoding UNICODE

    Example responses

    200 Response

    {
      "doneDate": "string",
      "errorCode": "string",
      "errorReason": "string",
      "from": "+49123456789",
      "href": "string",
      "mccmnc": "string",
      "parts": [
        {
          "currency": "EUR",
          "deliveryState": "string",
          "doneDate": "string",
          "errorCode": "string",
          "partId": "string",
          "price": -0.005,
          "priceEffective": "2018-06-01T00:00:00+0200",
          "sentDate": "2019-07-02T16:47:39+0200",
          "statusText": "string"
        }
      ],
      "priceEffective": "2019-11-08T16:34:56Z",
      "reference": "string",
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "sentDate": "2019-07-02T16:47:39+0200",
      "size": 1,
      "status": 400,
      "submitDate": "2019-11-08T16:34:56Z",
      "to": "+1987654321",
      "ttid": 77292
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The messageIds of your request RestMessageResponse
    201 Created Created None
    400 Bad Request Invalid request Problem
    401 Unauthorized Unauthorized Problem
    403 Forbidden Forbidden Problem
    404 Not Found Not Found Problem
    500 Internal Server Error Something went wrong :-( Problem

    Message Status

    You have the posibility to query the status of a message you sent through our systems. In case that that call-back URL is configured, we will POST the status to the defined URL

    The message status is available for three month after the final state is reached.

    Get status of a message

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("GET", "https://api.tyntec.com/messaging/v1/messages/{requestId}", 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/messages/{requestId} \
      -H 'Accept: application/json'
    
    
    GET https://api.tyntec.com/messaging/v1/messages/{requestId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/messaging/v1/messages/{requestId}");
    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'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/messages/{requestId}',
    {
      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'
    
    };
    
    fetch('https://api.tyntec.com/messaging/v1/messages/{requestId}',
    {
      method: 'GET',
    
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    
    import requests
    headers = {
      'Accept': 'application/json'
    }
    
    r = requests.get('https://api.tyntec.com/messaging/v1/messages/{requestId}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/json'
    }
    
    result = RestClient.get 'https://api.tyntec.com/messaging/v1/messages/{requestId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /messaging/v1/messages/{requestId}

    Query the status of a message.

    Parameters
    Name In Type Required Description
    requestId path string true The unique identifier provided for each request.

    Example responses

    200 Response

    {
      "doneDate": "string",
      "errorCode": "string",
      "errorReason": "string",
      "from": "+49123456789",
      "href": "string",
      "mccmnc": "string",
      "parts": [
        {
          "currency": "EUR",
          "deliveryState": "string",
          "doneDate": "string",
          "errorCode": "string",
          "partId": "string",
          "price": -0.005,
          "priceEffective": "2018-06-01T00:00:00+0200",
          "sentDate": "2019-07-02T16:47:39+0200",
          "statusText": "string"
        }
      ],
      "priceEffective": "2019-11-08T16:34:56Z",
      "reference": "string",
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "sentDate": "2019-07-02T16:47:39+0200",
      "size": 1,
      "status": 400,
      "submitDate": "2019-11-08T16:34:56Z",
      "to": "+1987654321",
      "ttid": 77292
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK RestMessageResponse
    401 Unauthorized Unauthorized Problem
    403 Forbidden Forbidden Problem
    404 Not Found Not Found Problem
    500 Internal Server Error Something went wrong :-( Problem

    Receive SMS

    The Messaging API enables you to receive messages from your customers sent to phone numbers you have registered with tyntec.

    For this service you will need to provide tyntec with the URL (callbackUrl) of your webserver, e.g. https://rest.customer.com/inboundmessages/.

    tyntec's application will do either a POST or GET call to you server; this can be configured by tyntec.

    tyntec's application will retry delivery every 10 seconds in case your application does not accept the inbound message. Retries are paused for 10 minutes after every 100 consecutive unsuccessful delivery attempts. tyntec's application will retry for a maximum of 48 hours.

    Receive SMS

    Code samples

    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
    
        }
    
        data := bytes.NewBuffer([]byte{jsonReq})
        req, err := http.NewRequest("POST", "https://api.tyntec.com/incoming", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X POST https://api.tyntec.com/incoming \
      -H 'Content-Type: application/json'
    
    
    POST https://api.tyntec.com/incoming HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/incoming");
    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 = '{
      "from": "+49123456789",
      "to": "+1987654321",
      "message": "This is an example, the data is garbage",
      "originMCC": 260,
      "originMNC": "09",
      "originTtId": 77292,
      "totalPrice": -0.005,
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "size": 1,
      "missingParts": false,
      "contentList": [
        {
          "msgId": "48799399408:0:cad578e86b324c0a80f8fe866bfdb2b6",
          "sentDate": "2019-07-02T16:47:39+0200",
          "sequenceNumber": 1,
          "price": -0.005,
          "currency": "EUR",
          "priceEffective": "2018-06-01T00:00:00+0200"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('https://api.tyntec.com/incoming',
    {
      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 = '{
      "from": "+49123456789",
      "to": "+1987654321",
      "message": "This is an example, the data is garbage",
      "originMCC": 260,
      "originMNC": "09",
      "originTtId": 77292,
      "totalPrice": -0.005,
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "size": 1,
      "missingParts": false,
      "contentList": [
        {
          "msgId": "48799399408:0:cad578e86b324c0a80f8fe866bfdb2b6",
          "sentDate": "2019-07-02T16:47:39+0200",
          "sequenceNumber": 1,
          "price": -0.005,
          "currency": "EUR",
          "priceEffective": "2018-06-01T00:00:00+0200"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json'
    
    };
    
    fetch('https://api.tyntec.com/incoming',
    {
      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'
    }
    
    r = requests.post('https://api.tyntec.com/incoming', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Content-Type' => 'application/json'
    }
    
    result = RestClient.post 'https://api.tyntec.com/incoming',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /incoming

    Receive a SMS

    The path is only an example.

    You can choose freely the callback url.

    Body parameter

    {
      "from": "+49123456789",
      "to": "+1987654321",
      "message": "This is an example, the data is garbage",
      "originMCC": 260,
      "originMNC": "09",
      "originTtId": 77292,
      "totalPrice": -0.005,
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "size": 1,
      "missingParts": false,
      "contentList": [
        {
          "msgId": "48799399408:0:cad578e86b324c0a80f8fe866bfdb2b6",
          "sentDate": "2019-07-02T16:47:39+0200",
          "sequenceNumber": 1,
          "price": -0.005,
          "currency": "EUR",
          "priceEffective": "2018-06-01T00:00:00+0200"
        }
      ]
    }
    
    Parameters
    Name In Type Required Description
    body body InboundMessage true The message tyntec delivers to your system.

    Responses

    Status Meaning Description Schema
    2XX Unknown Message was accepted by your system. None
    default Default Message was not accepted by your system.

    tyntec's inbound system will retry the delivery|None|

    Schemas

    RestMessagePart

    {
      "currency": "EUR",
      "deliveryState": "string",
      "doneDate": "string",
      "errorCode": "string",
      "partId": "string",
      "price": -0.005,
      "priceEffective": "2018-06-01T00:00:00+0200",
      "sentDate": "2019-07-02T16:47:39+0200",
      "statusText": "string"
    }
    
    

    The part of the message request that the message is split

    Properties

    Name Type Required Restrictions Description
    currency string false none The currency in which the pricing is given; corresponding to the currency of the invoice.
    deliveryState string false none The delivery status of this specific part. Possible values are given in a following table.
    doneDate string false none The time stamp when the message was successfully delivered.
    errorCode string false none The reason for an unsuccessful delivery attempt.
    partId string false none The identification number of the specific part of the message
    price number false none The price per message from the respective network. Negative prices represent payout in favor of tyntec’s customer.
    priceEffective string(date-time) false none The date when the “price” became effective.
    sentDate string false none The time stamp when the message was sent out by tyntec for delivery.
    statusText string false none The first 20 characters of the sent message.

    RestMessageResponse

    {
      "doneDate": "string",
      "errorCode": "string",
      "errorReason": "string",
      "from": "+49123456789",
      "href": "string",
      "mccmnc": "string",
      "parts": [
        {
          "currency": "EUR",
          "deliveryState": "string",
          "doneDate": "string",
          "errorCode": "string",
          "partId": "string",
          "price": -0.005,
          "priceEffective": "2018-06-01T00:00:00+0200",
          "sentDate": "2019-07-02T16:47:39+0200",
          "statusText": "string"
        }
      ],
      "priceEffective": "2019-11-08T16:34:56Z",
      "reference": "string",
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "sentDate": "2019-07-02T16:47:39+0200",
      "size": 1,
      "status": 400,
      "submitDate": "2019-11-08T16:34:56Z",
      "to": "+1987654321",
      "ttid": 77292
    }
    
    

    Properties

    Name Type Required Restrictions Description
    doneDate string false none The time stamp when the message was successfully delivered.
    errorCode string false none The error code.
    errorReason string false none The reason for an unsuccessful attempt.
    from string false none The phone number of the sending party in international format if available.
    href string false none The URL of the message accepted.
    mccmnc string false none A representative IMSI prefix of the target network. The respective mapping can be found at http://mcc-mnc.com/
    parts [RestMessagePart] false none [The part of the message request that the message is split]
    priceEffective string(date-time) false none The date when the “price” became active.
    reference string false none A custom reference that will mark the Delivery Report
    requestId string false none The unique identifier provided for each messaging request.
    sentDate string false none The time stamp when the message was sent out by tyntec for delivery.
    size integer(int32) false none The amount of respective concatenated SMS parts.
    status string false none The HTTP status code (RFC7231, Section 6) generated by the origin server for this occurrence of the problem.
    submitDate string(date-time) false none The date when the message was sent out by tyntec for delivery.
    to string false none Your number provided by tyntec that has received the respective message in international format.
    ttid string false none The tyntec id of the operator.

    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

    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.

    InboundMessage

    {
      "from": "+49123456789",
      "to": "+1987654321",
      "message": "This is an example, the data is garbage",
      "originMCC": 260,
      "originMNC": "09",
      "originTtId": 77292,
      "totalPrice": -0.005,
      "requestId": "e74db8d4-77ad-4671-8feb-9bc76b0df188",
      "size": 1,
      "missingParts": false,
      "contentList": [
        {
          "msgId": "48799399408:0:cad578e86b324c0a80f8fe866bfdb2b6",
          "sentDate": "2019-07-02T16:47:39+0200",
          "sequenceNumber": 1,
          "price": -0.005,
          "currency": "EUR",
          "priceEffective": "2018-06-01T00:00:00+0200"
        }
      ]
    }
    
    

    InboundMessage

    Properties

    Name Type Required Restrictions Description
    from string true none The phone number of the sending party in international format if available.
    to string true none Your number provided by tyntec that has received the respective message in international format.
    message string true none The received message as an UTF-8 encoded string. Note: Missing parts of a concat message will be marked with <...> in the message
    originMCC string false none A representative MCC (Mobile Country Code) of the originating network.
    originMNC string false none A representative MNC (Mobile Network Code) of the originating network.
    originTtId string false none The tyntec id of the operator.
    totalPrice number false none The sum of prices for each message part listed in “contentList”.
    requestId string true none The unique identifier provided for each request.
    size integer(int32) false none The amount of respective concatenated SMS parts.
    missingParts boolean true none This flag marks if tyntec has received all parts of a concat message within a time limit of 10 minutes
    contentList [InboundContent] true none tyntec merges over-length (concatenated) SMS into one string before sending it to your webserver. Note: tyntec will charge for each part of the concatenated message as an individual message!

    InboundContent

    {
      "msgId": "48799399408:0:cad578e86b324c0a80f8fe866bfdb2b6",
      "sentDate": "2019-07-02T16:47:39+0200",
      "sequenceNumber": 1,
      "price": -0.005,
      "currency": "EUR",
      "priceEffective": "2018-06-01T00:00:00+0200"
    }
    
    

    InboundContent

    Properties

    Name Type Required Restrictions Description
    msgId string true none The unique identifier provided for each message part.
    sentDate string true none The time when the SMS has been received by the sending MSC (if available) or the time when the respective message was received by tyntec.
    sequenceNumber integer(int32) true none The sequenceNumber orders the respective message parts of an overlength message.
    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 false none The date when the “price” became effective.