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 |

    This is the Bring Your Own Number service

    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.8

    | 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": "2020-02-14T12:14:53Z"
    }
    

    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{
            "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/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 'Content-Type: application/json' \
      -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
    Content-Type: application/json
    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 inputBody = '{
      "status": "read"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}',
    {
      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 = '{
      "status": "read"
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/channels/whatsapp/messages/{message-id}',
    {
      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/messages/{message-id}', 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/messages/{message-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

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

    Marks a previously received whatsapp message as read

    Body parameter

    {
      "status": "read"
    }
    
    Parameters
    Name In Type Required Description
    body body WhatsAppMessageStatusUpdate true The status change to execute
    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": "2020-02-14T12:14:53.232Z",
      "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

    Applications

    The Chat API allows you to freely define which events should be sent via a callback URL to your webhook implementation.

    Please note:

    • By now, only a default application is supported. The extension to custom applications is planned for future releases
    • The API merges events pointing to the same callback URL into one set.
    • When an update of a callback URL is executed, the whole webhook definition must be restated.

    List all applications

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

    GET /applications

    Lists all applications configured for the APIKey

    Example responses

    200 Response

    [
      {
        "id": "default",
        "name": "Default Application",
        "webhooks": [
          {
            "events": [
              "MoMessage"
            ],
            "callbackUrl": "https://some-call-back.service.com"
          },
          {
            "events": [
              "MessageStatus::deleted",
              "MessageStatus::accepted"
            ],
            "callbackUrl": "https://some-other-call-back.service.com"
          }
        ]
      }
    ]
    

    Responses

    Status Meaning Description Schema
    200 OK List of applications. Will never be empty ApplicationList

    Get default 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/chat-api/v2/applications/default", 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/applications/default \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY'
    
    
    GET https://api.tyntec.com/chat-api/v2/applications/default HTTP/1.1
    Host: api.tyntec.com
    Accept: application/json
    
    
    URL obj = new URL("https://api.tyntec.com/chat-api/v2/applications/default");
    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/applications/default',
    {
      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/applications/default',
    {
      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/applications/default', 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/applications/default',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    GET /applications/default

    Returns default application configured for the APIKey

    Example responses

    200 Response

    {
      "id": "default",
      "name": "Default Application",
      "webhooks": [
        {
          "events": [
            "MoMessage"
          ],
          "callbackUrl": "https://some-call-back.service.com"
        },
        {
          "events": [
            "MessageStatus::deleted",
            "MessageStatus::accepted"
          ],
          "callbackUrl": "https://some-other-call-back.service.com"
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Current definition of the default application DefaultApplicationResponse

    Update default application

    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/applications/default", 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/applications/default \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/problem+json' \
      -H 'apikey: API_KEY'
    
    
    PATCH https://api.tyntec.com/chat-api/v2/applications/default 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/applications/default");
    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 = '{
      "webhooks": [
        {
          "events": [
            "MoMessage"
          ],
          "callbackUrl": "https://some-call-back.service.com"
        },
        {
          "events": [
            "MessageStatus::deleted",
            "MessageStatus::accepted"
          ],
          "callbackUrl": "https://some-other-call-back.service.com"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/applications/default',
    {
      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 = '{
      "webhooks": [
        {
          "events": [
            "MoMessage"
          ],
          "callbackUrl": "https://some-call-back.service.com"
        },
        {
          "events": [
            "MessageStatus::deleted",
            "MessageStatus::accepted"
          ],
          "callbackUrl": "https://some-other-call-back.service.com"
        }
      ]
    }';
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/problem+json',
      'apikey':'API_KEY'
    
    };
    
    fetch('https://api.tyntec.com/chat-api/v2/applications/default',
    {
      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/applications/default', 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/applications/default',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PATCH /applications/default

    The operation will save the specified webhooks. Makes merge(replacement) operation on existing event types for newly defined webhooks. Any other event type of the existing webhooks will remain associated with the previous callback URL.

    Body parameter

    {
      "webhooks": [
        {
          "events": [
            "MoMessage"
          ],
          "callbackUrl": "https://some-call-back.service.com"
        },
        {
          "events": [
            "MessageStatus::deleted",
            "MessageStatus::accepted"
          ],
          "callbackUrl": "https://some-other-call-back.service.com"
        }
      ]
    }
    
    Parameters
    Name In Type Required Description
    body body DefaultApplicationUpdate true none

    Example responses

    400 Response

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

    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 Webhooks have been successfully saved. None
    400 Bad Request The request does not match our expectations. Please check the Problems object for details 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 group admins

    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}/admins", 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}/admins \
      -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}/admins 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}/admins");
    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}/admins',
    {
      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}/admins',
    {
      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}/admins', 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}/admins',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

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

    Returns current admins 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 admins 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

    Promote a participant

    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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-id} \
      -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}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    PUT /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-id}

    Promotes the participant identified by the id to a group admin.

    Note : This operation enables the user to manage the group participants.

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id
    whats-app-id path string true Whatsapp id of a user

    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 User was successfully promoted. 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

    Demote the admin

    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}/admins/{whats-app-id}", 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}/admins/{whats-app-id} \
      -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}/admins/{whats-app-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/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-id}");
    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}/admins/{whats-app-id}',
    {
      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}/admins/{whats-app-id}',
    {
      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}/admins/{whats-app-id}', 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}/admins/{whats-app-id}',
      params: {
      }, headers: headers
    
    p JSON.parse(result)
    
    

    DELETE /channels/whatsapp/phone-numbers/{phone-number}/groups/{group-id}/admins/{whats-app-id}

    Demotes the admin identified by the id to a participant.

    Parameters
    Name In Type Required Description
    phone-number path integer true Phone number used for WhatsApp messaging.
    group-id path string true Group id
    whats-app-id path string true Whatsapp id of a user

    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 Admin was successfully demoted to a participant. 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.
    format query string false The format the icon should be returned
    Enumerated Values
    Parameter Value
    format link
    format binary

    Example responses

    200 Response

    {
      "link": "https://pps.whatsapp.net/v/123123"
    }
    

    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 Current logo WhatsAppProfileLogoLink
    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.
    format query string false The format the icon should be returned
    Enumerated Values
    Parameter Value
    format link
    format binary

    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."
          },
          {
            "default": "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.
    contacts [Contact] false none [Contact object]
    Enumerated Values
    Property Value
    contentType template
    contentType text
    contentType url
    contentType media
    contentType location
    contentType contacts

    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