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 [Two Factor Authentication Application structure]
    » 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 the auto generated PIN length. PIN length can be between 4-11 digits.
    » 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 [Two Factor Authentication Application structure]
    » 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 the auto generated PIN length. PIN length can be between 4-11 digits.
    » 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 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 Application ID 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 The destination telephone number in E.164 format

    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 [OTP Status schema]
    » accountId string false none This is your 2FA accountId in the tyntec system. You cannot change this value
    » applicationId string false none The Universally Unique ID (UUID) that identifies the specific application used to deliver this OTP
    » attemptCount integer(int32) false none The number of attempts made for this OTP to be validated
    » created integer(int64) false none The time that the OTP request was created in milliseconds
    » expire integer(int64) false none The time that the OTP will expire in milliseconds
    » number string false none The destination telephone number in E.164 format
    » otpId string false none The OTP ID that the code should be resent
    » otpStatus string false none The OTP status. Possible values, ACTIVE, when the OTP is still active; VERIFIED, when the OTP was verified successfully; EXPIRED, when the OTP expired; TOO_MANY_ATTEMPTS, when the OTP validation requests exceeded the maximum allowed by the application configuration.
    » referenceId string false none Set your custom reference ID
    » timestampCreated string false none The string timestamp “created” representation in UTC Z format
    » timestampExpire string false none The string timestamp “expire” representation in UTC Z format

    Status Code 204

    Name Type Required Restrictions Description
    anonymous [OtpStatusEntity] false none [OTP Status schema]
    » accountId string false none This is your 2FA accountId in the tyntec system. You cannot change this value
    » applicationId string false none The Universally Unique ID (UUID) that identifies the specific application used to deliver this OTP
    » attemptCount integer(int32) false none The number of attempts made for this OTP to be validated
    » created integer(int64) false none The time that the OTP request was created in milliseconds
    » expire integer(int64) false none The time that the OTP will expire in milliseconds
    » number string false none The destination telephone number in E.164 format
    » otpId string false none The OTP ID that the code should be resent
    » otpStatus string false none The OTP status. Possible values, ACTIVE, when the OTP is still active; VERIFIED, when the OTP was verified successfully; EXPIRED, when the OTP expired; TOO_MANY_ATTEMPTS, when the OTP validation requests exceeded the maximum allowed by the application configuration.
    » referenceId string false none Set your custom reference ID
    » timestampCreated string false none The string timestamp “created” representation in UTC Z format
    » timestampExpire string false none The string timestamp “expire” representation in UTC Z format

    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 destination telephone number in E.164 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 The length of the auto generated PIN length. PIN length can be between 4-11 digits.
    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 The OTP ID that the code should be resent

    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 The OTP ID that the code should be resent

    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 The OTP ID that the code should be resent

    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 [Status schema]
    » created integer(int64) false none Timestamp in Epoch/Unix time
    » status string false none Event status. Possible values success/failed/null
    » statusText string false none The status reported by the deivery system
    » timestampCreated string false none The string timestamp “created” representation in UTC Z format
    » type string false none Refere to the next table regarding all event types

    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 The OTP ID that the code should be resent
    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 schema

    Properties

    Name Type Required Restrictions Description
    accountId string false none This is your 2FA accountId in the tyntec system. You cannot change this value
    applicationId string false none The Universally Unique ID (UUID) that identifies the specific application used to deliver this OTP
    attemptCount integer(int32) false none The number of attempts made for this OTP to be validated
    created integer(int64) false none The time that the OTP request was created in milliseconds
    expire integer(int64) false none The time that the OTP will expire in milliseconds
    number string false none The destination telephone number in E.164 format
    otpId string false none The OTP ID that the code should be resent
    otpStatus string false none The OTP status. Possible values, ACTIVE, when the OTP is still active; VERIFIED, when the OTP was verified successfully; EXPIRED, when the OTP expired; TOO_MANY_ATTEMPTS, when the OTP validation requests exceeded the maximum allowed by the application configuration.
    referenceId string false none Set your custom reference ID
    timestampCreated string false none The string timestamp “created” representation in UTC Z format
    timestampExpire string false none The string timestamp “expire” representation in UTC Z format

    StatusEvent

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

    Status schema

    Properties

    Name Type Required Restrictions Description
    created integer(int64) false none Timestamp in Epoch/Unix time
    status string false none Event status. Possible values success/failed/null
    statusText string false none The status reported by the deivery system
    timestampCreated string false none The string timestamp “created” representation in UTC Z format
    type string false none Refere to the next table regarding all event types

    TwoFactorAuthApplicationEntity

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

    Two Factor Authentication Application structure

    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 the auto generated PIN length. PIN length can be between 4-11 digits.
    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
    }
    
    

    Error Response schema

    Properties

    Name Type Required Restrictions Description
    code string false none The reason for an unsuccessful attempt
    id string false none Error code ID
    message string false none Textual representation of the code, containing further information
    timestamp integer(int64) false none Timestamp in Epoch/Unix time

    BYON API

    Version : v1.0

    | Specification | Release Notes | Other versions |

    BYON API

    Base URLs:

    Contact Service

    Contacts Service

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

    GET /contacts/v1

    Returns all contacts created by your API key. You can get the contact id from the list for editing or deleting the contact. You can specify friendlyName to filter the results.

    Parameters
    Name In Type Required Description
    friendlyName query string false A filter on the list based on the friendlyName field.

    Example responses

    200 Response

    [
      {
        "contacts": [
          {
            "companyAddress": "string",
            "companyName": "string",
            "contactEmail": "string",
            "contactName": "string",
            "contactPhone": "string",
            "contactTitle": "string",
            "friendlyName": "string"
          }
        ],
        "size": 0
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The list of contacts Inline
    204 No Content Empty list. No contacts found for this friendly name 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 [ContactArrayResponse] false none [Contract Array Response schema]
    » contacts [ContactEntity] false none [Contract Entity schema]
    »» companyAddress string false none Company's postal address
    »» companyName string false none Company's name
    »» contactEmail string false none e-mail address
    »» contactName string false none Name of the requestor
    »» contactPhone string false none Phone number of the requestor
    »» contactTitle string false none Title of the requestor
    »» friendlyName string false none A filter on the list based on the friendlyName field.
    » size integer(int32) false none none

    Status Code 204

    Name Type Required Restrictions Description
    anonymous [ContactArrayResponse] false none [Contract Array Response schema]
    » contacts [ContactEntity] false none [Contract Entity schema]
    »» companyAddress string false none Company's postal address
    »» companyName string false none Company's name
    »» contactEmail string false none e-mail address
    »» contactName string false none Name of the requestor
    »» contactPhone string false none Phone number of the requestor
    »» contactTitle string false none Title of the requestor
    »» friendlyName string false none A filter on the list based on the friendlyName field.
    » size integer(int32) false none none

    Create a contact

    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/byon/contacts/v1", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X POST https://api.tyntec.com/byon/contacts/v1 \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/byon/contacts/v1 HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/byon/contacts/v1");
    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 = '{
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/contacts/v1',
    {
      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 = '{
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/contacts/v1',
    {
      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/byon/contacts/v1', 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/byon/contacts/v1',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /contacts/v1

    Create a new contact

    Body parameter

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    
    Parameters
    Name In Type Required Description
    body body ContactEntity true A comma-separated list of contact details.
    Detailed descriptions

    body: A comma-separated list of contact details.

    • companyAddress (optional)
    • companyName
    • contactEmail
    • contactName
    • contactPhone
    • contactTitle (optional)
    • friendlyName (optional)

    Example responses

    200 Response

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK OK ContactEntity
    201 Created Created None
    202 Accepted The contact as been created ContactEntity
    400 Bad Request Not valid contact provided None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Contact not found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Return contact

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

    GET /contacts/v1/{contactId}

    Returns the contact for the provided contactId.

    Parameters
    Name In Type Required Description
    contactId path string true A filter on the list based on the contactId field.

    Example responses

    200 Response

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    

    Responses

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

    Edit contact

    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/byon/contacts/v1/{contactId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X POST https://api.tyntec.com/byon/contacts/v1/{contactId} \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/byon/contacts/v1/{contactId} HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/byon/contacts/v1/{contactId}");
    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 = '{
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/contacts/v1/{contactId}',
    {
      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 = '{
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/contacts/v1/{contactId}',
    {
      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/byon/contacts/v1/{contactId}', 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/byon/contacts/v1/{contactId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /contacts/v1/{contactId}

    Edit the contact for the provided contactId.

    Body parameter

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    
    Parameters
    Name In Type Required Description
    contactId path string true Contact ID to be edited.
    body body ContactEntity true A comma-separated list of contact details.
    Detailed descriptions

    body: A comma-separated list of contact details.

    • companyAddress (optional)
    • companyName
    • contactEmail
    • contactName
    • contactPhone
    • contactTitle (optional)
    • friendlyName (optional)

    Example responses

    200 Response

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The edited contact ContactEntity
    201 Created Created None
    400 Bad Request Contact can not be edited None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Contact not found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Delete contact

    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/byon/contacts/v1/{contactId}", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X DELETE https://api.tyntec.com/byon/contacts/v1/{contactId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    DELETE https://api.tyntec.com/byon/contacts/v1/{contactId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/byon/contacts/v1/{contactId}");
    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/byon/contacts/v1/{contactId}',
    {
      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/byon/contacts/v1/{contactId}',
    {
      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/byon/contacts/v1/{contactId}', 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/byon/contacts/v1/{contactId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    DELETE /contacts/v1/{contactId}

    Delete the contact for the provided contactId.

    Parameters
    Name In Type Required Description
    contactId path string true The unique identifier of the contact to delete.

    Example responses

    200 Response

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The deleted contact ContactEntity
    204 No Content No Content None
    400 Bad Request Contact can not be deleted None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found Contact not found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Phone Book Service

    Phone Book Service

    Returns all phones

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

    GET /provisioning/v1

    Returns all phone numbers provisioning requests created. You can specify friendlyName or contactId for filtering the results.

    Parameters
    Name In Type Required Description
    friendlyName query string false A filter on the list based on the friendlyName field.
    contactId query string false A filter on the list based on the contactId field.

    Example responses

    200 Response

    [
      {
        "provisioningRequests": [
          {
            "accountId": "string",
            "contactId": "string",
            "friendlyName": "string",
            "requestId": "string",
            "status": "string"
          }
        ],
        "size": 0
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The list of phone provisioning requests Inline
    204 No Content Empty list. No phone provisioning requests found 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 [PhoneProvisioningArrayResponse] false none [Phone provisioning array response schema]
    » provisioningRequests [PhoneProvisioningEntity] false none [Phone provisioning schema]
    »» accountId string false none The account that created this entry
    »» contactId string false none Contact ID of this entry
    »» friendlyName string false none Friendly name of this entry
    »» requestId string false none Request ID of this entry
    »» status string false none Status of this entry
    » size integer(int32) false none none

    Status Code 204

    Name Type Required Restrictions Description
    anonymous [PhoneProvisioningArrayResponse] false none [Phone provisioning array response schema]
    » provisioningRequests [PhoneProvisioningEntity] false none [Phone provisioning schema]
    »» accountId string false none The account that created this entry
    »» contactId string false none Contact ID of this entry
    »» friendlyName string false none Friendly name of this entry
    »» requestId string false none Request ID of this entry
    »» status string false none Status of this entry
    » size integer(int32) false none none

    createPhoneProvisioningRequestUsingPOST

    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/byon/provisioning/v1", data)
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        // ...
    }
    
    
    # You can also use wget
    curl -X POST https://api.tyntec.com/byon/provisioning/v1?contactId=string \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    POST https://api.tyntec.com/byon/provisioning/v1?contactId=string HTTP/1.1
    Host: api.tyntec.com
    Content-Type: application/json
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/byon/provisioning/v1?contactId=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 inputBody = '[
      {
        "phoneNumber": "string",
        "country": "string",
        "operator": "string",
        "ip": [
          "string"
        ],
        "callbackUrl": "string"
      }
    ]';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/provisioning/v1?contactId=string',
    {
      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 = '[
      {
        "phoneNumber": "string",
        "country": "string",
        "operator": "string",
        "ip": [
          "string"
        ],
        "callbackUrl": "string"
      }
    ]';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/provisioning/v1?contactId=string',
    {
      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/byon/provisioning/v1', params={
      'contactId': 'string'
    }, 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/byon/provisioning/v1',
      params: {
      'contactId' => 'string'
    }, headers: headers
    
    p JSON.parse(result)
    
    

    POST /provisioning/v1

    New phone batch provisioning

    Body parameter

    [
      {
        "phoneNumber": "string",
        "country": "string",
        "operator": "string",
        "ip": [
          "string"
        ],
        "callbackUrl": "string"
      }
    ]
    
    Parameters
    Name In Type Required Description
    friendlyName query string false A filter on the list based on the friendlyName field.
    contactId query string true A filter on the list based on the contactId field.
    body body array[object] true A comma-separated list of phone number details.
    Detailed descriptions

    body: A comma-separated list of phone number details.

    • phoneNumber
    • country (only optional if the phone number already included the country code)

    Example responses

    200 Response

    {
      "accountId": "string",
      "contactId": "string",
      "friendlyName": "string",
      "requestId": "string",
      "status": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The list of applications PhoneProvisioningEntity
    201 Created Created None
    204 No Content Empty list. No applications found for your account PhoneProvisioningEntity
    400 Bad Request Your request was not valid None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The contact was not found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Phone 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/byon/provisioning/v1/{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/byon/provisioning/v1/{requestId} \
      -H 'Accept: application/json' \
      -H 'apiKey: API_KEY'
    
    
    GET https://api.tyntec.com/byon/provisioning/v1/{requestId} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/byon/provisioning/v1/{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',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/provisioning/v1/{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',
      'apiKey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/byon/provisioning/v1/{requestId}',
    {
      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/byon/provisioning/v1/{requestId}', 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/byon/provisioning/v1/{requestId}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /provisioning/v1/{requestId}

    Returns the details of the provisioning request for the provided requestId.

    Parameters
    Name In Type Required Description
    requestId path string true A unique identifier based on the requestId field.

    Example responses

    200 Response

    {
      "accountId": "string",
      "contactId": "string",
      "friendlyName": "string",
      "requestId": "string",
      "status": "string"
    }
    

    Responses

    Status Meaning Description Schema
    200 OK The provisioning request PhoneProvisioningEntity
    400 Bad Request Your request was not valid None
    401 Unauthorized Unauthorized None
    403 Forbidden Forbidden None
    404 Not Found The provisioning request was not found None
    500 Internal Server Error Something went wrong :-( ErrorResponse

    Numbers Service

    Numbers service endpoint

    Return all phone numbers

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

    GET /phonebook/v1/numbers

    Returns all phone numbers created by your API key. You can specify attributes to filter the results. The size limit is 3000

    Parameters
    Name In Type Required Description
    requestId query string false A filter on the list based on the requestId field.
    contactId query string false A filter on the list based on the contactId field.
    page query integer(int32) false A filter on the list based on the page field.
    size query integer(int32) false A filter on the list based on the size field.

    Example responses

    200 Response

    [
      {
        "provisioningRequests": [
          {
            "accountId": "string",
            "contactId": "string",
            "friendlyName": "string",
            "requestId": "string",
            "status": "string"
          }
        ],
        "size": 0
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The list of phones requests 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 [PhoneProvisioningArrayResponse] false none [Phone provisioning array response schema]
    » provisioningRequests [PhoneProvisioningEntity] false none [Phone provisioning schema]
    »» accountId string false none The account that created this entry
    »» contactId string false none Contact ID of this entry
    »» friendlyName string false none Friendly name of this entry
    »» requestId string false none Request ID of this entry
    »» status string false none Status of this entry
    » size integer(int32) false none none

    Returns the specific phone number entity

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

    GET /phonebook/v1/numbers/{phoneNumber}

    Returns the specific phone number entity created by your API key.

    Parameters
    Name In Type Required Description
    phoneNumber path string true Phone number to get information for.

    Example responses

    200 Response

    [
      {
        "provisioningRequests": [
          {
            "accountId": "string",
            "contactId": "string",
            "friendlyName": "string",
            "requestId": "string",
            "status": "string"
          }
        ],
        "size": 0
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK The Phone Number entity 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 [PhoneProvisioningArrayResponse] false none [Phone provisioning array response schema]
    » provisioningRequests [PhoneProvisioningEntity] false none [Phone provisioning schema]
    »» accountId string false none The account that created this entry
    »» contactId string false none Contact ID of this entry
    »» friendlyName string false none Friendly name of this entry
    »» requestId string false none Request ID of this entry
    »» status string false none Status of this entry
    » size integer(int32) false none none

    Schemas

    ContactArrayResponse

    {
      "contacts": [
        {
          "companyAddress": "string",
          "companyName": "string",
          "contactEmail": "string",
          "contactName": "string",
          "contactPhone": "string",
          "contactTitle": "string",
          "friendlyName": "string"
        }
      ],
      "size": 0
    }
    
    

    Contract Array Response schema

    Properties

    Name Type Required Restrictions Description
    contacts [ContactEntity] false none [Contract Entity schema]
    size integer(int32) false none none

    ContactEntity

    {
      "companyAddress": "string",
      "companyName": "string",
      "contactEmail": "string",
      "contactName": "string",
      "contactPhone": "string",
      "contactTitle": "string",
      "friendlyName": "string"
    }
    
    

    Contract Entity schema

    Properties

    Name Type Required Restrictions Description
    companyAddress string false none Company's postal address
    companyName string false none Company's name
    contactEmail string false none e-mail address
    contactName string false none Name of the requestor
    contactPhone string false none Phone number of the requestor
    contactTitle string false none Title of the requestor
    friendlyName string false none A filter on the list based on the friendlyName field.

    ErrorResponse

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

    Error Response schema

    Properties

    Name Type Required Restrictions Description
    code string false none error code
    message string false none A short, human-readable summary of the problem type.
    timestamp integer(int64) false none Point in time when the event happend

    PhoneNumberEntity

    {
      "phoneNumber": "string",
      "country": "string",
      "operator": "string",
      "ip": [
        "string"
      ],
      "callbackUrl": "string"
    }
    
    

    Phone number schema

    Properties

    Name Type Required Restrictions Description
    phoneNumber string false none Phone number of the contact
    country string false none The country that the phone number is registered
    operator string false none Operator's network
    ip [string] false none IP address of the phone
    callbackUrl string false none none

    PhoneProvisioningArrayResponse

    {
      "provisioningRequests": [
        {
          "accountId": "string",
          "contactId": "string",
          "friendlyName": "string",
          "requestId": "string",
          "status": "string"
        }
      ],
      "size": 0
    }
    
    

    Phone provisioning array response schema

    Properties

    Name Type Required Restrictions Description
    provisioningRequests [PhoneProvisioningEntity] false none [Phone provisioning schema]
    size integer(int32) false none none

    PhoneProvisioningEntity

    {
      "accountId": "string",
      "contactId": "string",
      "friendlyName": "string",
      "requestId": "string",
      "status": "string"
    }
    
    

    Phone provisioning schema

    Properties

    Name Type Required Restrictions Description
    accountId string false none The account that created this entry
    contactId string false none Contact ID of this entry
    friendlyName string false none Friendly name of this entry
    requestId string false none Request ID of this entry
    status string false none Status of this entry

    ResponseEntity

    {
      "body": {},
      "statusCode": "100",
      "statusCodeValue": 0
    }
    
    

    Response schema

    Properties

    Name Type Required Restrictions Description
    body object false none A short, human-readable summary of the response.
    statusCode string false none ID of the response
    statusCodeValue integer(int32) false none Response code value
    Enumerated Values
    Property Value
    statusCode 100
    statusCode 101
    statusCode 102
    statusCode 103
    statusCode 200
    statusCode 201
    statusCode 202
    statusCode 203
    statusCode 204
    statusCode 205
    statusCode 206
    statusCode 207
    statusCode 208
    statusCode 226
    statusCode 300
    statusCode 301
    statusCode 302
    statusCode 303
    statusCode 304
    statusCode 305
    statusCode 307
    statusCode 308
    statusCode 400
    statusCode 401
    statusCode 402
    statusCode 403
    statusCode 404
    statusCode 405
    statusCode 406
    statusCode 407
    statusCode 408
    statusCode 409
    statusCode 410
    statusCode 411
    statusCode 412
    statusCode 413
    statusCode 414
    statusCode 415
    statusCode 416
    statusCode 417
    statusCode 418
    statusCode 419
    statusCode 420
    statusCode 421
    statusCode 422
    statusCode 423
    statusCode 424
    statusCode 426
    statusCode 428
    statusCode 429
    statusCode 431
    statusCode 451
    statusCode 500
    statusCode 501
    statusCode 502
    statusCode 503
    statusCode 504
    statusCode 505
    statusCode 506
    statusCode 507
    statusCode 508
    statusCode 509
    statusCode 510
    statusCode 511

    Chat API

    Version : v2.7

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

    The Chat API allows you to easily send messages to your customers via messaging services like WhatsApp and still reach 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.

    Channel specific pre-conditions

    • 2-way SMS : Please contact us to get the details for the 2-way SMS setup
    • WhatsApp : A WhatsApp Business Account is required in order to use this channel. Please request access here

    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-12-06T16:14:08Z"
    }
    

    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

    Mark whatsapp message as read

    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("PUT", "https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}", 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/messages/{message-id} \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    PUT https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id} HTTP/1.1
    Host: api.tyntec.com
    Accept: application/problem+json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}");
    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/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}',
    {
      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/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}',
    {
      method: 'PUT',
    
      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.put('https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}', params={
    
    }, headers = headers)
    
    print r.json()
    
    
    require 'rest-client'
    require 'json'
    
    headers = {
      'Accept' => 'application/problem+json',
      'apikey' => 'API_KEY'
    }
    
    result = RestClient.put 'https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /channels/whatsapp/messages/{message-id}

    Marks a previously received whatsapp message as read

    Parameters
    Name In Type Required Description
    message-id path string true The id of the mo message

    Example responses

    404 Response

    {
      "status": 404,
      "title": "Not Found"
    }
    

    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 Message was successfully marked as read None
    404 Not Found No MO Message found for the given id 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-12-06T16:14:08.792Z",
      "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 none
    template Template false none The message template to be send.
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media

    SMSRequest

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

    Normal SMS to be send.

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

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

    Properties

    Name Type Required Restrictions Description
    contentType string 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 none
    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 none
    template Template false none The message template to be send.
    replyBack boolean false none Should the channel reply back the send message
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media

    Media

    {
      "type": "audio",
      "url": "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp4"
    }
    
    

    Properties

    oneOf

    Name Type Required Restrictions Description
    anonymous AudioMedia false none Audio file to be send

    xor

    Name Type Required Restrictions Description
    anonymous ImageMedia false none Image to be send

    xor

    Name Type Required Restrictions Description
    anonymous DocumentMedia false none Document to be send

    xor

    Name Type Required Restrictions Description
    anonymous VideoMedia false none Video file to be send

    AudioMedia

    {
      "type": "audio",
      "url": "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.mp4"
    }
    
    

    Audio file to be send

    Properties

    Name Type Required Restrictions Description
    type string true none What kind of media should be send
    url string true none the url of the location where the audio file is stored
    Enumerated Values
    Property Value
    type audio

    ImageMedia

    {
      "type": "image",
      "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec-logo-color.png"
    }
    
    

    Image to be send

    Properties

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

    DocumentMedia

    {
      "type": "document",
      "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
      "caption": "Tyntec Pricelist",
      "filename": "tyntec_pricelist.pdf"
    }
    
    

    Document to be send

    Properties

    Name Type Required Restrictions Description
    type string true none What kind of media should be send
    url string true none the url of the location where the document is stored
    caption string false none Additional caption for the document. It is shown on the uploaded document when the channel supports this
    filename string false none File name of the document to be shown. It is shown on the uploaded document when the channel supports this
    Enumerated Values
    Property Value
    type document

    VideoMedia

    {
      "type": "video",
      "url": "http://techslides.com/demos/sample-videos/small.mp4",
      "caption": "Tyntec Party"
    }
    
    

    Video file to be send

    Properties

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

    Template

    {
      "templateId": "weclome_message",
      "language": {
        "policy": "deterministic",
        "example": "en"
      },
      "components": [
        {
          "type": "header",
          "parameters": [
            {
              "type": "media",
              "media": {
                "type": "image",
                "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec-logo-color.png"
              }
            }
          ]
        },
        {
          "type": "body",
          "parameters": [
            {
              "type": "text",
              "text": "Hi!"
            }
          ]
        }
      ]
    }
    
    

    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
    components [anyOf] false none Parameter for replacement in the template. Header and body components can only be used once.

    anyOf

    Name Type Required Restrictions Description
    » anonymous HeaderComponent false none none

    or

    Name Type Required Restrictions Description
    » anonymous BodyComponent false none none

    continued

    Name Type Required Restrictions Description
    parameters [TemplateParameter] false none Parameter for replacement in the template. NOTE : This parameter is deprecated by version 2.7 and will be removed in the next major release. Instead use components.

    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.

    NOTE : This parameter is deprecated by version 2.7 and will be removed in the next major release. Instead use components.

    Properties

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

    HeaderComponent

    {
      "type": "header",
      "parameters": [
        {
          "type": "media",
          "media": {
            "type": "image",
            "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec-logo-color.png"
          }
        }
      ]
    }
    
    

    Properties

    Name Type Required Restrictions Description
    type string false none none
    parameters [oneOf] false none none
    Enumerated Values
    Property Value
    type header

    BodyComponent

    {
      "type": "body",
      "parameters": [
        {
          "type": "text",
          "text": "Sam"
        },
        {
          "type": "text",
          "text": "nice replacement"
        }
      ]
    }
    
    

    Properties

    Name Type Required Restrictions Description
    type string false none none
    parameters [anyOf] false none none
    Enumerated Values
    Property Value
    type body

    TextParameter

    {
      "type": "text",
      "text": "Hi! Cool replacement"
    }
    
    

    Properties

    Name Type Required Restrictions Description
    type string false none none
    text string false none Text 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.
    Enumerated Values
    Property Value
    type text

    TemplateMediaParameter

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

    Properties

    Name Type Required Restrictions Description
    type string false none none
    media any false none none

    oneOf

    Name Type Required Restrictions Description
    » anonymous ImageMedia false none Image to be send

    xor

    Name Type Required Restrictions Description
    » anonymous TemplateDocumentMedia false none Media to be send
    Enumerated Values
    Property Value
    type media

    TemplateDocumentMedia

    {
      "type": "document",
      "url": "https://s1.q4cdn.com/806093406/files/doc_downloads/test.pdf",
      "filename": "Test document"
    }
    
    

    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
    filename string false none Additional info for the filename to be displayed.
    Enumerated Values
    Property Value
    type document

    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-12-06T16:14:08Z"
    }
    
    

    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-12-06T16:14:08.791Z"
    }
    
    

    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-12-06T16:14:08.792Z",
      "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-12-06T16:14:08.792Z",
      "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-12-06T16:14:08.792Z",
      "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-12-06T16:14:08.793Z",
      "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-12-06T16:14:08Z",
      "price": 0.1,
      "currency": "EUR",
      "priceEffective": "2019-12-06T16:14:08Z",
      "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-12-06T16:14:08.795Z",
      "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",