Code copied successfuly

Conversations API

Version: v3.7

Specification Release Notes Postman Collection Other versions

The Conversations API allows you to easily send messages to your customers via messaging services like WhatsApp or Viber and still reach customers with classic SMS, with a harmonized data model over all channels.

This API is designed for 2-way messaging (sending and receiving), which allows interactive conversations with your customers.

Delivery notifications (message status updates) and inbound messages from your customers are sent by us to your system via the HTTP POST method. For details see Receiving status updates and Receiving inbound messages.

Channels

The Conversations API provides messaging services via several channels, currently:

  • WhatsApp
  • Viber
  • 2-way SMS (sending and receiving)
  • Telegram (Beta)
  • WeChat (Beta)

Note: If you want to send SMS only, check out our SMS API, which is preferred for 1-way SMS messaging.

Channel specific prerequisites

  • WhatsApp: A WhatsApp Business Account (WABA) is required in order to use this channel.
    Please request your access here.
  • Viber: A Viber Service ID is required in order to use this channel.
    Please request your access here.
  • Telegram: Please contact us for getting access to the beta program for Telegram via onboarding@tyntec.com.
  • WeChat: Please contact us for getting access to the beta program for WeChat via onboarding@tyntec.com.
  • 2-way SMS: Please contact us to get the details for the 2-way SMS setup.

Scope based access control

The Conversations API uses the concept of scopes to control access to different aspects of your Conversations account and channels available to you.

Scopes are divided into two distinct classes read and write.

read grants you read-only access - GET HTTP calls -.

write provides access to data modification or message submission - POST, PATCH, PUT, DELETE HTTP calls -.

Scopes are used on 2 layers, your API key account and the channels available to it.

You can inspect the scopes available to both layers by fetching the information via Configurations.

We reserve the right to revoke any granted scope in case we do detect abusive usage of the API.

Adhered web standards

In addition to the compliance common to all our APIs, the Conversations API complies also with:

RFC 5988 is implemented to allow all API calls that return a list of resources, to make use of the following Link headers:

  • first – The first page in the list of requested sub-resources
  • previous – The page preceding the current page in the list of requested sub-resources
  • current – The current page in the list of requested sub-resources
  • next – The page following the current page in the list of requested sub-resources
  • last – The last page in the list of requested sub-resources

In addition, the following custom headers are provided for convenience:

  • x-total-pages – The total number of pages in the list of requested sub-resources
  • x-total-items – The total number of items in the list of requested sub-resources
  • x-page-size – The size of a page (maximum number of items on a single page)
  • x-current-page – The page number of the current page in the list of requested sub-resources

Common operations

Version: v3.0

Specification Release Notes Other versions

In this section, you find an overview of operations common to all Conversations channels.

The Conversations API works as a wrapper for messaging on varied channels and aims to provide a common data model unified to the greatest possible extent.

Here are some guidelines on general usage. For details about interaction on a particular channel, please refer to the channel-specific section.

Sending messages

All channels use the same endpoint and generic data model for requests to send messages. However, the components of messages beyond plain text are channel-specific. Some channels enforce special policies and restrictions, for example, the WhatsApp channel, and you need to watch that you comply with them in the context of your use case.

For details on the channels, please refer to the channel-specific section.

Media and other non-text content

Some channels allow you to attach images, video, audio, stickers, buttons, or URLs. These kinds of content are channel-specific.

Bulk messaging

All channels provide the functionality of sending bulks of messages. A bulk of messages is always sent via one channel to a single recipient.

Our system guarantees that the messages are sent to the recipient in the requested order.

Receiving status updates

The API allows you to automatically receive delivery notifications and status updates about messages that you sent to your channels.

For this service, you will need to provide a URL (messageStatusUrl) at your webserver, e.g. https://rest.customer.com/messagestatus/. This URL must serve a webhook able to process POST HTTP requests, which the tyntec system will fire upon events in the system, in this case upon message status updates.

You may also configure an opt-in filter on one or more MessageStatus::* event types in the Configuration, see Webhook Configuration and Webhook Events V2. The set of available event types slightly varies on each channel:

Channel Accepted Dispatched Delivered Seen Channel failed Deleted
WhatsApp
Viber
Telegram
WeChat
SMS

Retries

The tyntec system will retry to post the request 2 more times in the case your webhook does not accept the request (final response codes other than 2xx).

Receiving inbound messages

The API allows you to automatically receive inbound messages sent to your channels by your customers.

Note: For the SMS channel, you need to ask us to enable 2-way interaction, see Channel specific prerequisites.

For this service, you will need to provide a URL (inboundMessageUrl) at your webserver, e.g. https://rest.customer.com/inboundmessages/. This URL must serve a webhook able to process POST HTTP requests, which the tyntec system will fire upon the events of inbound messages.

The events fired upon are of type MoMessage.

Retries

The tyntec system will retry to post the request in the case your webhook does not accept the request (final response codes other than 2xx), depending on the channel as follows:

  • WhatsApp: retries via the WhatsApp mechanism with exponential decrease in frequency of attempts that continues up to 14 days (attempts repeat less and less often)
  • Viber: TODO
  • WeChat: TODO
  • Telegram: TODO
  • SMS: retries every 10 seconds. Retries are paused for 10 minutes after every 100 consecutive unsuccessful delivery attempts. tyntec's system will keep trying for a maximum of 48 hours.

Base URLs

Message details

Operations on single sent messages common to all channels. They provide detailed information about sent messages.

Check message status

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/messages/{messageId}/status \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/messages/{messageId}/status HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/messages/{messageId}/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/messages/{messageId}/status',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/messages/{messageId}/status', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/messages/{messageId}/status', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/messages/{messageId}/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/messages/{messageId}/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /messages/{messageId}/status

Check the status of a message

Parameters

Name In Type Required Description
messageId path string(uuid) true The message id provided by tyntec

Example responses

200 Response

{
  "messageId": "8540d774-4863-4d2b-b788-4ecb19412e85",
  "status": "string",
  "timestamp": "2019-08-24T14:15:22Z"
}

404 Response

{
  "type": "https://httpstatuses.com/404",
  "title": "Not Found",
  "status": 404
}

Responses

Status Meaning Description Schema
200 OK The response after the server has accepted the request MessageStatus
404 Not Found The requested element was not found Problem
default Default The default response in case of any other error. Please check the error object for details Problem

List delivery events

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/messages/{messageId}/events \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/messages/{messageId}/events HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/messages/{messageId}/events',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/messages/{messageId}/events',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/messages/{messageId}/events', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/messages/{messageId}/events', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/messages/{messageId}/events");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/messages/{messageId}/events", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /messages/{messageId}/events

List the delivery events of a message

Parameters

Name In Type Required Description
messageId path string(uuid) true The message id provided by tyntec

Example responses

200 Response

{
  "messageId": "8540d774-4863-4d2b-b788-4ecb19412e85",
  "events": [
    {
      "timestamp": "2021-11-19T06:39:28.081Z",
      "event": "MessageStatus::channelFailed",
      "channel": "whatsapp",
      "details": {
        "code": "whatsapp::error::470",
        "message": "Message failed to send because more than 24 hours have passed since the customer last replied to this number"
      }
    }
  ]
}

404 Response

{
  "type": "https://httpstatuses.com/404",
  "title": "Not Found",
  "status": 404
}

Responses

Status Meaning Description Schema
200 OK The list of delivery events MessageDeliveryEvents
404 Not Found The requested element was not found Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Inbound media

After receiving an inbound message (MoMessage event) with a media ID, this endpoint can be used to download the media file.

Download media file

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/media/{mediaId} \
  -H 'Accept: audio/*' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/media/{mediaId} HTTP/1.1
Host: api.tyntec.com
Accept: audio/*
apikey: API_KEY


const headers = {
  'Accept':'audio/*',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/media/{mediaId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'audio/*',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/media/{mediaId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'audio/*',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/media/{mediaId}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'audio/*',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/media/{mediaId}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/media/{mediaId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "audio/*");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"audio/*"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/media/{mediaId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /media/{mediaId}

Retrieve the media associated with the id

Parameters

Name In Type Required Description
mediaId path string(uuid) true Media ID provided by tyntec

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

Outbound media (Beta)

As an alternative to the download of outbound media on message requests, we enable you to upload a media file and use it later when sending messages.

After a successful upload, we generate an ID that is used as an alternative to the media URL.

The uploaded media can be stored

  • as a static asset
  • only for a certain period
  • for one-time usage

As this is in beta, we grant access to it only via an approved access request.

List uploaded media files

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/media \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/media HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/media',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/media',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/media', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/media', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/media");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/media", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /media

Lists all uploaded media files

Example responses

200 Response

[
  {
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad",
    "contentType": "string",
    "validity": "2019-08-24T14:15:22Z",
    "fileName": "string",
    "fileSize": 0
  }
]

Responses

Status Meaning Description Schema
200 OK list of stored media files Inline
default Default The default response in case of any other error. Please check the error object for details Problem
Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [MediaResponse] false none none
» mediaId string(uuid) false none The media ID provided by tyntec
» contentType string false none The media type
» validity string(date-time) false none For how long is the media stored in minutes
» fileName string false none The name of the file
» fileSize integer false none The size of the file in bytes

Upload a media file

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/media \
  -H 'Content-Type: */*' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/media HTTP/1.1
Host: api.tyntec.com
Content-Type: */*
Accept: application/json
apikey: API_KEY

const inputBody = 'string';
const headers = {
  'Content-Type':'*/*',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/media',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => '*/*',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/media',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': '*/*',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/media', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => '*/*',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/media', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/media");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "*/*");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"*/*"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/media", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /media

Uploads a media file for message sending

Body parameter

Parameters

Name In Type Required Description
validity query integer false For how long is the media stored in minutes.
filename query string false the name of the file
body body string(binary) true the media to be uploaded

Example responses

200 Response

{
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad",
  "url": "string",
  "quota": 0,
  "usage": 0
}

Responses

Status Meaning Description Schema
200 OK The media was successfully uploaded MediaUploadResponse
default Default The default response in case of any other error. Please check the error object for details Problem

Delete a media file

Code samples

# You can also use wget
curl -X DELETE https://api.tyntec.com/conversations/v3/media/{mediaId} \
  -H 'Accept: application/problem+json' \
  -H 'apikey: API_KEY'

DELETE https://api.tyntec.com/conversations/v3/media/{mediaId} HTTP/1.1
Host: api.tyntec.com
Accept: application/problem+json
apikey: API_KEY


const headers = {
  'Accept':'application/problem+json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/media/{mediaId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.delete 'https://api.tyntec.com/conversations/v3/media/{mediaId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.delete('https://api.tyntec.com/conversations/v3/media/{mediaId}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.tyntec.com/conversations/v3/media/{mediaId}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/media/{mediaId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/problem+json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.tyntec.com/conversations/v3/media/{mediaId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /media/{mediaId}

Deletes a prior uploaded media.

Parameters

Name In Type Required Description
mediaId path string(uuid) true Media ID provided by tyntec

Example responses

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 The associated media was successfully deleted None
default Default The default response in case of any other error. Please check the error object for details Problem

Schemas

MessageRequest

{
  "to": "+123234234",
  "from": "545345345",
  "channel": "whatsapp",
  "content": {
    "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 message's recipient
The format depends on the specific channel
from string true none The sender of the messages. The format depends on the specific channel.
channel string true none The channel selected for delivery.
overrides MessageRequestOverrides false none Overrides of defaults for this message
context string false none The context for this particular message
content object false none The message's content. Refer to the channel specifics
Enumerated values
Property Value
channel sms
channel whatsapp
channel wechat
channel viber

MessageRequestOverrides

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

Overrides of defaults for this message

Properties

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

MessageResponse

{
  "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
  "timestamp": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
messageId string(uuid) true none A global unique Message Id reference
timestamp string(date-time) true none A point in time when the API confirms that the message request was accepted

MessageStatus

{
  "messageId": "8540d774-4863-4d2b-b788-4ecb19412e85",
  "status": "string",
  "timestamp": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
messageId string(uuid) false none Global unique Message Id reference
status string false none Current status of the message
timestamp string(date-time) false none Point in time when status has been entered

MessageDeliveryEvents

{
  "messageId": "8540d774-4863-4d2b-b788-4ecb19412e85",
  "events": [
    {
      "timestamp": "2021-11-19T06:39:28.081Z",
      "event": "MessageStatus::channelFailed",
      "channel": "whatsapp",
      "details": {
        "code": "whatsapp::error::470",
        "message": "Message failed to send because more than 24 hours have passed since the customer last replied to this number"
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
messageId string(uuid) true none Global unique Message Id reference
events [MessageDeliveryEvent] true none none

MessageDeliveryEvent

{
  "timestamp": "2021-11-19T06:39:28.081Z",
  "event": "MessageStatus::channelFailed",
  "channel": "whatsapp",
  "details": {
    "code": "whatsapp::error::470",
    "message": "Message failed to send because more than 24 hours have passed since the customer last replied to this number"
  }
}

Properties

Name Type Required Restrictions Description
timestamp string(date-time) true none Point in time when the event has happened.
event string true none Determines which kind of event has happened.
channel string false none Channel selected for delivery.
details object false none Channel specific details.
» code string true none none
» message string true none none
Enumerated values
Property Value
channel sms
channel whatsapp
channel wechat
channel viber

BulkMessageRequest

{}

Properties

None

BulkMessageResponse

{
  "bulkId": "string",
  "messageIds": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
bulkId string false none none
messageIds [string] false none none

MediaUploadResponse

{
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad",
  "url": "string",
  "quota": 0,
  "usage": 0
}

Properties

Name Type Required Restrictions Description
mediaId string(uuid) true none none
url string true none none
quota integer true none none
usage integer true none none

MediaResponse

{
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad",
  "contentType": "string",
  "validity": "2019-08-24T14:15:22Z",
  "fileName": "string",
  "fileSize": 0
}

Properties

Name Type Required Restrictions Description
mediaId string(uuid) false none The media ID provided by tyntec
contentType string false none The media type
validity string(date-time) false none For how long is the media stored in minutes
fileName string false none The name of the file
fileSize integer false none The size of the file in bytes

Problem

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

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

Properties

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

WhatsApp

Version: v3.10

Specification Release Notes Other versions

The Conversations API allows you to easily send messages to your customers via WhatsApp

Channel specific pre-conditions

  • WhatsApp : A WhatsApp Business Account is required in order to use this channel. Please request access here

Product & Product Lists (beta)

The support for product and product lists is currently in beta status on our API.

Please contact us via WhatsApp or support@tyntec.com

Base URLs

Messaging

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

Send a message

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/messages \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/messages HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/json
apikey: API_KEY

const inputBody = '{
  "from": "a cool business",
  "to": "some number",
  "channel": "whatsapp",
  "content": {
    "contentType": "text",
    "text": "hi there"
  },
  "context": "my-message-reference"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/messages',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/messages',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/messages', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/messages', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/messages");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/messages", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /messages

Send messages via this path.

Body parameter

{
  "from": "a cool business",
  "to": "some number",
  "channel": "whatsapp",
  "content": {
    "contentType": "text",
    "text": "hi there"
  },
  "context": "my-message-reference"
}

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",
  "timestamp": "2019-08-24T14:15:22Z"
}

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 response after the server has accepted the request 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 The default response in case of any other error. Please check the error object for details Problem

Send a bulk message

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/bulks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/bulks HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/json
apikey: API_KEY

const inputBody = '{
  "to": "+1233423454",
  "from": "+1233423454",
  "channel": "whatsapp",
  "messages": [
    {
      "contentType": "text",
      "text": "string",
      "renderUrlPreview": false
    },
    {
      "contentType": "text",
      "text": "string",
      "renderUrlPreview": false
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/bulks',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/bulks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/bulks', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/bulks', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/bulks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/bulks", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /bulks

Send bulk messages. Bulk messages are defined as ordered messages to one receiver.

Body parameter

{
  "to": "+1233423454",
  "from": "+1233423454",
  "channel": "whatsapp",
  "messages": [
    {
      "contentType": "text",
      "text": "string",
      "renderUrlPreview": false
    },
    {
      "contentType": "text",
      "text": "string",
      "renderUrlPreview": false
    }
  ]
}

Parameters

Name In Type Required Description
body body BulkMessageRequest true The message bulk you would like to send

Example responses

202 Response

{
  "bulkId": "string",
  "messageIds": [
    "string"
  ]
}

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 response after the server has accepted the request BulkMessageResponse
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 The default response in case of any other error. Please check the error object for details Problem

Mark a message as read

Code samples

# You can also use wget
curl -X PUT https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/problem+json' \
  -H 'apikey: API_KEY'

PUT https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id} HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/problem+json
apikey: API_KEY

const inputBody = '{
  "status": "read"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/problem+json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.put 'https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.put('https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/problem+json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.tyntec.com/conversations/v3/channels/whatsapp/messages/{message-id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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 MoMessage

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 MoMessage was found for the given Message ID. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Account management

Account management grants you access to information about the WhatsApp accounts provisioned to you.

At the moment, it does not support requesting new WhatsApp accounts or editing existing ones.

The subresources of a WhatsApp account can only be managed by API accounts with the respective scopes.

Manageable subresources are:

  • templates

Read access to an account is available for all accounts that are associated with a phone number and thus eligible for sending messages.

List accounts

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/accounts

Lists all WhatsApp accounts managed by these access credentials.

If the phone number query parameter is set, only the phone numbers account is listed.

Parameters

Name In Type Required Description
phone-number query integer false The phone number used for WhatsApp messaging

Example responses

200 Response

[
  {
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "whatsAppAccountName": "Swagger Sample Account",
    "businessName": "Swagger Sample business",
    "templateNamespace": "c9468969-a3a3-4c17-95f7-1e8b2902ed74",
    "facebookBusinessManagerId": 1791147717848878,
    "accountStatus": {
      "messageOnBehalf": "PENDING"
    },
    "managedBy": {
      "accountName": "tynteccpaas"
    }
  }
]

Responses

Status Meaning Description Schema
200 OK Returned a list of WhatsApp accounts WhatsAppAccounts
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
200 x-total-pages integer How many pages are available
200 x-total-items integer How many items are available in total
200 x-page-size integer The maximum number of items per page
200 x-current-page integer The current page
200 Link undefined Links describing pagination

Read an account

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id} \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id} HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/accounts/{whatsapp-account-id}

Returns details of a WhatsApp account.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID

Example responses

200 Response

{
  "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
  "whatsAppAccountName": "Swagger Sample Account",
  "businessName": "Swagger Sample business",
  "templateNamespace": "c9468969-a3a3-4c17-95f7-1e8b2902ed74",
  "facebookBusinessManagerId": 1791147717848878,
  "accountStatus": {
    "messageOnBehalf": "PENDING"
  },
  "managedBy": {
    "accountName": "tynteccpaas"
  }
}

404 Response

{
  "status": 404,
  "title": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Returned a WhatsApp account WhatsAppAccount
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

List phone numbers

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/accounts/{whatsapp-account-id}/phone-numbers

Lists all phone numbers of a WhatsApp account.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID

Example responses

200 Response

[
  {
    "phoneNumber": "49123456789",
    "displayPhoneNumber": "+49 123 45678",
    "verifiedName": "Swagger Sample",
    "qualityRating": "YELLOW",
    "status": "FLAGGED",
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "managedBy": {
      "accountName": "tyntecscpaas"
    },
    "messagingVia": {
      "accountName": "messagingcpaas"
    },
    "nameStatus": "APPROVED",
    "isOfficialBusinessAccount": false
  }
]

404 Response

{
  "status": 404,
  "title": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Returned phone numbers of a WhatsApp account WhatsAppPhoneNumbers
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
200 x-total-pages integer How many pages are available
200 x-total-items integer How many items are available in total
200 x-page-size integer The maximum number of items per page
200 x-current-page integer The current page
200 Link undefined Links describing pagination

Template management

Template management enables you to interact with the templates defined for your WhatsApp account.

You can specify examples for the parameters of each localization. This is advised to increase the chance of acceptance of templates. If you use examples, all dynamic parts of the template, like media header or body parameters, must be specified.

It's advised to do this at least for the media templates, as WhatsApp has changed the policies due to abuse of media headers to distribute spam / inappropriate content.

We support creating or deleting templates and adding new localizations to an existing template.

Due to restrictions by WhatsApp, editing is not supported yet.

List templates

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/accounts/{whatsapp-account-id}/templates

Lists all templates of your WhatsApp account.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID

Example responses

200 Response

[
  {
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "templateName": "swagger_test",
    "category": "MARKETING",
    "localizations": [
      {
        "status": "REJECTED",
        "rejectionReason": "For this example",
        "language": "en",
        "components": [
          {
            "type": "BODY",
            "text": "Hello {{1}}! How is going?"
          },
          {
            "type": "FOOTER",
            "text": "Your specification team!"
          }
        ]
      }
    ]
  }
]

404 Response

{
  "status": 404,
  "title": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Returned the templates WhatsAppTemplates
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
200 x-total-pages integer How many pages are available
200 x-total-items integer How many items are available in total
200 x-page-size integer The maximum number of items per page
200 x-current-page integer The current page
200 Link undefined Links describing pagination

Submit a template for review

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/problem+json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/problem+json
apikey: API_KEY

const inputBody = '{
  "name": "welcome",
  "category": "UTILITY",
  "localizations": [
    {
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "text": "Hi {{1}},\n\nWelcome to our support.\nHow can we help you?\n\nYour support team\n"
        }
      ]
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/problem+json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/problem+json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /channels/whatsapp/accounts/{whatsapp-account-id}/templates

Creates a new template that is submitted for review to Facebook.

Body parameter

{
  "name": "welcome",
  "category": "UTILITY",
  "localizations": [
    {
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "text": "Hi {{1}},\n\nWelcome to our support.\nHow can we help you?\n\nYour support team\n"
        }
      ]
    }
  ]
}

Parameters

Name In Type Required Description
body body WhatsAppTemplateRequest true The template to be submitted
whatsapp-account-id path string true WhatsApp account ID
Detailed description

body: The template to be submitted

Example responses

400 Response

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

404 Response

{
  "status": 404,
  "title": "WhatsApp account 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
201 Created The requested resource was created. None
400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
201 Location string The URI of the newly created resource

Read a template

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id} \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id} HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}

Returns details of a template in your WhatsApp account.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID
template-id path string true Referenced template

Example responses

200 Response

{
  "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
  "templateName": "swagger_test",
  "category": "MARKETING",
  "localizations": [
    {
      "status": "REJECTED",
      "rejectionReason": "For this example",
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "text": "Hello {{1}}! How is going?"
        },
        {
          "type": "FOOTER",
          "text": "Your specification team!"
        }
      ]
    }
  ]
}

404 Response

{
  "status": 404,
  "title": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Returned the template from your account WhatsAppTemplateResponse
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Delete a template

Code samples

# You can also use wget
curl -X DELETE https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id} \
  -H 'Accept: application/problem+json' \
  -H 'apikey: API_KEY'

DELETE https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id} HTTP/1.1
Host: api.tyntec.com
Accept: application/problem+json
apikey: API_KEY


const headers = {
  'Accept':'application/problem+json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.delete 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.delete('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/problem+json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}

Deletes the template from your WhatsApp account.

After deleting the template, a 30-days grace period is starting. This is indicated by the expiresAt property of the localizations.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID
template-id path string true Referenced template

Example responses

404 Response

{
  "status": 404,
  "title": "WhatsApp account 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 Deletion of the template is pending now. None
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

List localizations

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations

Lists localizations of a template.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID
template-id path string true Referenced template

Example responses

200 Response

[
  {
    "status": "DELETED",
    "rejectionReason": "not yet",
    "language": "en",
    "components": [
      {
        "type": "BODY",
        "text": "Hello {{1}}! How is going?"
      }
    ],
    "createdAt": "2020-02-15T23:28:34.442Z",
    "lastUpdated": "2020-02-15T25:28:34.442Z",
    "expiresAt": "2020-03-15T23:28:34.442Z",
    "qualityScore": {
      "score": "RED",
      "reasons": [
        "Users are choosing \"didn't sign up\" as a reason for blocking this phone number. Businesses must obtain opt-in before sending notifications. Please review your opt-in flow(s) and see our Business Policy for more detail."
      ]
    }
  }
]

404 Response

{
  "status": 404,
  "title": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Returned localizations of the template. Inline
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem
Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [LocalizationResponse] false none [A localization of a template]
» status string true none The status of the localization.
» rejectionReason string false none The descriptive text in the case the status is REJECTED
» language LanguageCode true none The supported language codes, according to Supported Languages
» components [anyOf] true none A set of components defining a template

anyOf

Name Type Required Restrictions Description
»» anonymous WhatsAppTemplateHeaderComponentResponse false none A header component of a template
»»» type string true none A component type
»»» format string true none What kind of header
»»» text string false none The textual part in the case the format is TEXT

or

Name Type Required Restrictions Description
»» anonymous WhatsAppTemplateBodyComponentResponse false none A body component of a template
»»» type string true none A component type
»»» text string true none The specification of the body text

or

Name Type Required Restrictions Description
»» anonymous WhatsAppTemplateFooterComponentResponse false none A footer component of a template
»»» type string true none A component type
»»» text string false none The specification of the footer text

continued

Name Type Required Restrictions Description
» createdAt string(date-time) true none At which point in time the template was created
» lastUpdated string(date-time) true none At which point in time the last update happened
» expiresAt string(date-time) false none When the localization expires.
Only present when a template was deleted.
» qualityScore QualityScore false none The quality score provided by WhatsApp and calculated from user feedback on your messages
»» score string true none The current scoring
»» reasons [string] false none A textual description of why the quality score is set to the value.
Only present when the score is YELLOW or RED
Enumerated values
Property Value
status REQUESTED
status SUBMIT_FAILED
status PENDING
status APPROVED
status REJECTED
status DELETION_PENDING
status DELETED
status SUBMITTED
language af
language ar
language az
language bg
language bn
language ca
language cs
language da
language de
language el
language en
language en_GB
language en_US
language es
language es_AR
language es_ES
language es_MX
language et
language fa
language fi
language fil
language fr
language ga
language gu
language ha
language he
language hi
language hr
language hu
language ID
language it
language ja
language kk
language kn
language ko
language lo
language lt
language lv
language mk
language ml
language mr
language ms
language nb
language nl
language pa
language pl
language pt_BR
language pt_PT
language ro
language ru
language sk
language sl
language sq
language sr
language sv
language sw
language ta
language te
language th
language tr
language uk
language ur
language uz
language vi
language zh_CN
language zh_HK
language zh_TW
language zu
type HEADER
format IMAGE
format TEXT
format DOCUMENT
format VIDEO
type BODY
type FOOTER
score unknown
score GREEN
score YELLOW
score RED

Add a localization

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/problem+json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/problem+json
apikey: API_KEY

const inputBody = '{
  "language": "en",
  "components": [
    {
      "type": "BODY",
      "text": "string"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/problem+json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/problem+json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/localizations

Adds a localization to a template. The localization will be separately reviewed by Facebook.

Body parameter

{
  "language": "en",
  "components": [
    {
      "type": "BODY",
      "text": "string"
    }
  ]
}

Parameters

Name In Type Required Description
body body LocalizationRequest true The localization to be submitted
whatsapp-account-id path string true WhatsApp account ID
template-id path string true Referenced template
Detailed description

body: The localization to be submitted

Example responses

400 Response

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

404 Response

{
  "status": 404,
  "title": "WhatsApp account 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
201 Created The requested resource was created. None
400 Bad Request The request does not match our expectations. Please check the Problems object for details Problem
404 Not Found The WhatsApp account does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
201 Location string The URI of the newly created resource

Phone Number insights

Phone Number insights allow you to get information about the status of a phone number in your account.

It also provides read access to the templates usable with the phone number.

List phone numbers

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /channels/whatsapp/phone-numbers

Lists all phone numbers accessible for the given credentials.

Example responses

200 Response

[
  {
    "phoneNumber": "49123456789",
    "displayPhoneNumber": "+49 123 45678",
    "verifiedName": "Swagger Sample",
    "qualityRating": "YELLOW",
    "status": "FLAGGED",
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "managedBy": {
      "accountName": "tyntecscpaas"
    },
    "messagingVia": {
      "accountName": "messagingcpaas"
    },
    "nameStatus": "APPROVED",
    "isOfficialBusinessAccount": false
  }
]

Responses

Status Meaning Description Schema
200 OK Phone numbers assigned to your account WhatsAppPhoneNumbers
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
200 x-total-pages integer How many pages are available
200 x-total-items integer How many items are available in total
200 x-page-size integer The maximum number of items per page
200 x-current-page integer The current page
200 Link undefined Links describing pagination

Read a phone number

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number} \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number} HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Returns details about a phone number.

Parameters

Name In Type Required Description
phone-number path integer true The phone number used for WhatsApp messaging

Example responses

200 Response

{
  "phoneNumber": "49123456789",
  "displayPhoneNumber": "+49 123 45678",
  "verifiedName": "Swagger Sample",
  "qualityRating": "YELLOW",
  "status": "FLAGGED",
  "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
  "managedBy": {
    "accountName": "tyntecscpaas"
  },
  "messagingVia": {
    "accountName": "messagingcpaas"
  },
  "nameStatus": "APPROVED",
  "isOfficialBusinessAccount": false
}

404 Response

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

Responses

Status Meaning Description Schema
200 OK Returned the details about the phone number WhatsAppPhoneNumber
404 Not Found The phone number does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

List available templates

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/templates", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Lists all available templates for a phone number

Parameters

Name In Type Required Description
phone-number path integer true The phone number used for WhatsApp messaging

Example responses

200 Response

[
  {
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "templateName": "swagger_test",
    "category": "MARKETING",
    "localizations": [
      {
        "status": "REJECTED",
        "rejectionReason": "For this example",
        "language": "en",
        "components": [
          {
            "type": "BODY",
            "text": "Hello {{1}}! How is going?"
          },
          {
            "type": "FOOTER",
            "text": "Your specification team!"
          }
        ]
      }
    ]
  }
]

404 Response

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

Responses

Status Meaning Description Schema
200 OK Returned templates available for the phone number WhatsAppTemplates
404 Not Found The phone number does not exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Response Headers

Status Header Type Format Description
200 x-total-pages integer How many pages are available
200 x-total-items integer How many items are available in total
200 x-page-size integer The maximum number of items per page
200 x-current-page integer The current page
200 Link undefined Links describing pagination

Profile management

Profile management allows you to read and update the profile settings of your WhatsApp phone numbers.

Read the profile

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Returns the profile settings of a WhatsApp phone number

Parameters

Name In Type Required Description
phone-number path integer true The 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 Returned 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 exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Update the profile

Code samples

# You can also use wget
curl -X PATCH https://api.tyntec.com/conversations/v3/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/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/problem+json
apikey: API_KEY

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/conversations/v3/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);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.patch 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.patch('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/problem+json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/profile", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Updates the WhatsApp client profile.

Supports also selective updates.

To remove a particular field, set 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 Updated profile settings
phone-number path integer true The phone number used for WhatsApp messaging

Example responses

400 Response

{
  "status": 400,
  "title": "Profile update 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 Profile update failed. In the case a partial update failed: 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 exist. Problem
default Default The 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

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo \
  -H 'Accept: image/png' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo HTTP/1.1
Host: api.tyntec.com
Accept: image/png
apikey: API_KEY


const headers = {
  'Accept':'image/png',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'image/png',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'image/png',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'image/png',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "image/png");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"image/png"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Returns the current logo assigned to a WhatsApp phone number profile.

Parameters

Name In Type Required Description
format query string false The format in which the icon should be returned. The default is binary.
phone-number path integer true The phone number used for WhatsApp messaging
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 Returned the 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 exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Code samples

# You can also use wget
curl -X PUT https://api.tyntec.com/conversations/v3/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/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo HTTP/1.1
Host: api.tyntec.com
Content-Type: image/png
Accept: application/problem+json
apikey: API_KEY

const inputBody = 'string';
const headers = {
  'Content-Type':'image/png',
  'Accept':'application/problem+json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/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);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'image/png',
  'Accept' => 'application/problem+json',
  'apikey' => 'API_KEY'
}

result = RestClient.put 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'image/png',
  'Accept': 'application/problem+json',
  'apikey': 'API_KEY'
}

r = requests.put('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'image/png',
    'Accept' => 'application/problem+json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Content-Type", "image/png");
con.setRequestProperty("Accept", "application/problem+json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"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/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/logo", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Updates the logo assigned to a WhatsApp phone number profile.

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

The recommended size is 640x640 pixels.

Body parameter

Parameters

Name In Type Required Description
body body string(binary) true The image that should be used as the profile logo
phone-number path integer true The phone number used for WhatsApp messaging

Example responses

400 Response

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

403 Response

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

404 Response

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

default Response

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

Responses

Status Meaning Description Schema
204 No Content Updated the logo successfully 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 exist. Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Phone Number Configurations

List all phone numbers configured as Inbound (aka 2-way) Phone Numbers.

List Configurations

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /configurations/channels/whatsapp

List all WhatsApp phone number configurations available to your API account

Example responses

200 Response

[
  {
    "channel": "whatsapp",
    "scopes": [
      "messages:read",
      "profile:read",
      "callbacks:write",
      "callbacks:read"
    ],
    "id": {
      "phoneNumber": "12341234"
    },
    "callback": {
      "callbackVersion": "2.11",
      "inboundMessageUrl": "https://your.server.com/inbound",
      "messageStatusUrl": "https://your.server.com/status",
      "eventFilter": [
        "MessageStatus::accepted",
        "MessageStatus::delivered"
      ]
    }
  }
]

403 Response

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

Responses

Status Meaning Description Schema
200 OK A list of WhatsApp phone number configurations WhatsAppChannelResponses
403 Forbidden You attempting to use a number that is not assigned to your account Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Read one configuration

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number} \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number} HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

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

Returns the specific configuration

Parameters

Name In Type Required Description
phone-number path integer true The phone number used for WhatsApp messaging

Example responses

200 Response

{
  "channel": "whatsapp",
  "scopes": [
    "messages:read",
    "profile:read",
    "callbacks:write",
    "callbacks:read"
  ],
  "id": {
    "phoneNumber": "12341234"
  },
  "callback": {
    "callbackVersion": "2.11",
    "inboundMessageUrl": "https://your.server.com/inbound",
    "messageStatusUrl": "https://your.server.com/status",
    "eventFilter": [
      "MessageStatus::accepted",
      "MessageStatus::delivered"
    ]
  }
}

403 Response

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

Responses

Status Meaning Description Schema
200 OK The WhatsApp phone number configuration WhatsAppChannelResponse
403 Forbidden You attempting to use a number that is not assigned to your account Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Callback configuration

In this section, we guide you on how to configure the callbacks on a per-channel basis.

Update the callback

Code samples

# You can also use wget
curl -X PUT https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

PUT https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/json
apikey: API_KEY

const inputBody = '{
  "callbackVersion": "2.11",
  "inboundMessageUrl": "string",
  "messageStatusUrl": "string",
  "eventFilter": []
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.put 'https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.put('https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.tyntec.com/conversations/v3/configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /configurations/channels/whatsapp/phone-numbers/{phone-number}/callbacks

Update the callback settings of a specific phone number.

Body parameter

{
  "callbackVersion": "2.11",
  "inboundMessageUrl": "string",
  "messageStatusUrl": "string",
  "eventFilter": []
}

Parameters

Name In Type Required Description
body body ChannelCallback false none
phone-number path integer true The phone number used for WhatsApp messaging

Example responses

200 Response

{
  "channel": "whatsapp",
  "scopes": [
    "messages:read",
    "profile:read",
    "callbacks:write",
    "callbacks:read"
  ],
  "id": {
    "phoneNumber": "12341234"
  },
  "callback": {
    "callbackVersion": "2.11",
    "inboundMessageUrl": "https://your.server.com/inbound",
    "messageStatusUrl": "https://your.server.com/status",
    "eventFilter": [
      "MessageStatus::accepted",
      "MessageStatus::delivered"
    ]
  }
}

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
200 OK The WhatsApp phone number configuration WhatsAppChannelResponse
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 The default response in case of any other error. Please check the error object for details Problem

Schemas

Problem

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

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

Properties

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

MessageResponse

{
  "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
  "timestamp": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
messageId string(uuid) true none A global unique Message Id reference
timestamp string(date-time) true none A point in time when the API confirms that the message request was accepted

BulkMessageResponse

{
  "bulkId": "string",
  "messageIds": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
bulkId string false none none
messageIds [string] false none none

MessageRequest

{
  "to": "+123234234",
  "from": "545345345",
  "channel": "whatsapp",
  "content": {
    "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 message's recipient
The format depends on the specific channel
from string true none The sender of the messages. The format depends on the specific channel.
channel string true none The channel selected for delivery.
context string false none The context for this particular message
content any false none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppTextContent false none A plain text message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppImageContent false none Image message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppDocumentContent false none A document message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppVideoContent false none A video message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppAudioContent false none An audio message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppStickerContent false none A sticker message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppLocationContent false none A location message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppContactsContent false none A message with contacts

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateContent false none Templated message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveContent false none Interactive message
Enumerated values
Property Value
channel whatsapp

BulkMessageRequest

{
  "to": "+1233423454",
  "from": "+1233423454",
  "channel": "whatsapp",
  "messages": [
    {
      "contentType": "text",
      "text": "string",
      "renderUrlPreview": false
    },
    {
      "contentType": "text",
      "text": "string",
      "renderUrlPreview": false
    }
  ]
}

The bulk of messages you would like to send

Properties

Name Type Required Restrictions Description
to string true none The message's recipient
The format depends on the specific channel
from string true none The sender of the messages. The format depends on the specific channel.
channel string true none The channel selected for delivery.
messages [oneOf] true none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppTextContent false none A plain text message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppImageContent false none Image message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppDocumentContent false none A document message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppVideoContent false none A video message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppAudioContent false none An audio message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppStickerContent false none A sticker message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppLocationContent false none A location message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppContactsContent false none A message with contacts

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateContent false none Templated message
Enumerated values
Property Value
channel whatsapp

WhatsAppTextContent

{
  "contentType": "text",
  "text": "string",
  "renderUrlPreview": false
}

A plain text message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always text.
text string true none Text to be sent
renderUrlPreview boolean false none In case a URL is present on the text should a preview be tried to be rendered
Enumerated values
Property Value
contentType text

WhatsAppImageContent

{
  "contentType": "image",
  "image": {
    "caption": "string",
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

Image message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always image.
image WhatsAppImage true none An image media specification
Enumerated values
Property Value
contentType image

WhatsAppDocumentContent

{
  "contentType": "document",
  "document": {
    "caption": "string",
    "filename": "string",
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

A document message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always document.
document WhatsAppDocument true none A document media specification
Enumerated values
Property Value
contentType document

WhatsAppVideoContent

{
  "contentType": "video",
  "video": {
    "caption": "string",
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

A video message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always video.
video WhatsAppVideo true none A video media specification
Enumerated values
Property Value
contentType video

WhatsAppAudioContent

{
  "contentType": "audio",
  "audio": {
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

An audio message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always audio.
audio WhatsAppAudio true none An audio media specification
Enumerated values
Property Value
contentType audio

WhatsAppStickerContent

{
  "contentType": "sticker",
  "sticker": {
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

A sticker message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always sticker.
sticker WhatsAppSticker true none A sticker media specification
Enumerated values
Property Value
contentType sticker

WhatsAppLocationContent

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

A location message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always location.
location WhatsAppLocation true none Location received or send
Enumerated values
Property Value
contentType location

WhatsAppContactsContent

{
  "contentType": "contacts",
  "contacts": [
    {
      "birthday": "2018-01-01",
      "addresses": [
        {
          "city": "Dortmund",
          "country": "Germany",
          "countryCode": "de",
          "state": "NRW",
          "street": "string",
          "type": "WORK",
          "zip": "44231"
        }
      ],
      "emails": [
        {
          "email": "whatsapp@tyntec.com",
          "type": "WORK"
        }
      ],
      "ims": [
        {
          "service": "WhatsApp",
          "userId": "123123123"
        }
      ],
      "name": {
        "prefix": "Mr.",
        "firstName": "Peter",
        "middleName": "Michael",
        "lastName": "Tyntec",
        "suffix": "senior",
        "formattedName": "Mr. Peter Michael Tyntec senior"
      },
      "org": {
        "company": "tyntec GmbH",
        "department": "Development",
        "title": "API Guardian"
      },
      "phones": [
        {
          "phone": "+49 231 477 90 813",
          "type": "WORK"
        }
      ],
      "urls": [
        {
          "url": "https://www.tyntec.com",
          "type": "WORK"
        }
      ]
    }
  ]
}

A message with contacts

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always contacts.
contacts [Contact] true none [A contact object]
Enumerated values
Property Value
contentType contacts

WhatsAppTemplateContent

{
  "contentType": "template",
  "template": {
    "templateId": "string",
    "templateLanguage": "string",
    "components": {
      "header": [
        {
          "type": "text",
          "text": "string",
          "example": {
            "text": "John Doe"
          }
        }
      ],
      "body": [
        {
          "type": "text",
          "text": "string",
          "example": {
            "texts": [
              "John Doe",
              "Order ID 123"
            ]
          }
        }
      ],
      "button": [
        {
          "type": "quick_reply",
          "index": 0,
          "payload": "string"
        }
      ]
    }
  }
}

Templated message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always template.
template WhatsAppTemplate true none none
Enumerated values
Property Value
contentType template

WhatsAppInteractiveContent

{
  "contentType": "interactive",
  "interactive": {
    "subType": "buttons",
    "components": {
      "header": {
        "type": "text",
        "text": "Your request is queued"
      },
      "body": {
        "type": "text",
        "text": "How would you rate your bot experience"
      },
      "footer": {
        "type": "text",
        "text": "Your service bot"
      },
      "buttons": [
        {
          "type": "reply",
          "reply": {
            "payload": "987298-40980jvkdm9-234234234",
            "title": "Poor"
          }
        },
        {
          "type": "reply",
          "reply": {
            "payload": "987298-dsfgjlkhgdf-dg09u834334",
            "title": "OK"
          }
        },
        {
          "type": "reply",
          "reply": {
            "payload": "9080923445nlkjß0_gß0923845083245dfg",
            "title": "Good"
          }
        }
      ]
    }
  }
}

Interactive message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always interactive.
interactive any true none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveButtonMessage false none An interactive message type

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveListMessage false none An interactive message type

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveProductMessage false none Interactive Product Message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveProductListMessage false none Interactive Product List Message
Enumerated values
Property Value
contentType interactive

WhatsAppInteractiveFooterContent

{
  "type": "text",
  "text": "string"
}

The footer of an interactive message

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the message. Always text.
text string true none A footer to be displayed on the message
Enumerated values
Property Value
type text

WhatsAppInteractiveTextContent

{
  "type": "text",
  "text": "string"
}

The message body of an interactive message

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the message. Always text.
text string true none The text body of the message
Enumerated values
Property Value
type text

BaseMedia

{
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

A base object handling media definitions for sending.

One of both properties url or mediaId must be set

Properties

Name Type Required Restrictions Description
url string false none The URL of the location where the media is stored
mediaId string(uuid) false none The media id of previously uploaded media

WhatsAppImage

{
  "caption": "string",
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

An image media specification

Properties

Name Type Required Restrictions Description
caption string false none none

WhatsAppDocument

{
  "caption": "string",
  "filename": "string",
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

A document media specification

Properties

Name Type Required Restrictions Description
caption string false none none
filename string false none none

WhatsAppVideo

{
  "caption": "string",
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

A video media specification

Properties

Name Type Required Restrictions Description
caption string false none none

WhatsAppAudio

{
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

An audio media specification

Properties

None

WhatsAppSticker

{
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

A sticker media specification

Properties

None

WhatsAppLocation

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

Location received or send

Properties

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

Contact

{
  "birthday": "2018-01-01",
  "addresses": [
    {
      "city": "Dortmund",
      "country": "Germany",
      "countryCode": "de",
      "state": "NRW",
      "street": "string",
      "type": "WORK",
      "zip": "44231"
    }
  ],
  "emails": [
    {
      "email": "whatsapp@tyntec.com",
      "type": "WORK"
    }
  ],
  "ims": [
    {
      "service": "WhatsApp",
      "userId": "123123123"
    }
  ],
  "name": {
    "prefix": "Mr.",
    "firstName": "Peter",
    "middleName": "Michael",
    "lastName": "Tyntec",
    "suffix": "senior",
    "formattedName": "Mr. Peter Michael Tyntec senior"
  },
  "org": {
    "company": "tyntec GmbH",
    "department": "Development",
    "title": "API Guardian"
  },
  "phones": [
    {
      "phone": "+49 231 477 90 813",
      "type": "WORK"
    }
  ],
  "urls": [
    {
      "url": "https://www.tyntec.com",
      "type": "WORK"
    }
  ]
}

A contact object

Properties

Name Type Required Restrictions Description
birthday string false none The birthday of the contact
addresses [Address] false none A list of addresses assigned to the contact
emails [Email] false none A list of emails assigned to the contact
ims [IMS] false none A list of IMS accounts assigned to the contact
name Name false none The name of a contact. Apart from the property formattedName at least one of the other must be set
org Organisation false none An organisation associated with the contact
phones [ContactPhone] false none A list of phone numbers assigned to the contact
urls [ContactUrl] false none A list of URLs assigned to the contact

Address

{
  "city": "Dortmund",
  "country": "Germany",
  "countryCode": "de",
  "state": "NRW",
  "street": "string",
  "type": "WORK",
  "zip": "44231"
}

An address of a contact

Properties

Name Type Required Restrictions Description
city string false none The city name
country string false none The full country name
countryCode string false none The two-letter code abbreviation
state string false none The state abbreviation
street string false none The street name and number
type string false none The type of address
zip string false none The ZIP or postal code

Email

{
  "email": "whatsapp@tyntec.com",
  "type": "WORK"
}

An email of the contact

Properties

Name Type Required Restrictions Description
email string false none The email address
type string false none The type of email

IMS

{
  "service": "WhatsApp",
  "userId": "123123123"
}

An IMS of the contact

Properties

Name Type Required Restrictions Description
service string false none The type of the the service
userId string false none The IMS user id

Name

{
  "prefix": "Mr.",
  "firstName": "Peter",
  "middleName": "Michael",
  "lastName": "Tyntec",
  "suffix": "senior",
  "formattedName": "Mr. Peter Michael Tyntec senior"
}

The name of a contact. Apart from the property formattedName at least one of the other must be set

Properties

Name Type Required Restrictions Description
prefix string false none A prefix of the contact's name
firstName string false none The first name of the contact
middleName string false none The middle name of the contact
lastName string false none The last name of the contact
suffix string false none A suffix of the contact's name
formattedName string true none The completely formatted name

Organisation

{
  "company": "tyntec GmbH",
  "department": "Development",
  "title": "API Guardian"
}

An organisation associated with the contact

Properties

Name Type Required Restrictions Description
company string false none The name of the contact's company
department string false none The name of the contact's department
title string false none The contact's business title

ContactPhone

{
  "phone": "+49 231 477 90 813",
  "type": "WORK"
}

A phone entry of a contact

Properties

Name Type Required Restrictions Description
phone string false none The phone number
type string false none The type of phone number

ContactUrl

{
  "url": "https://www.tyntec.com",
  "type": "WORK"
}

An URL of a contact

Properties

Name Type Required Restrictions Description
url string false none The URL of a contact
type string false none The type of URL

WhatsAppTemplate

{
  "templateId": "string",
  "templateLanguage": "string",
  "components": {
    "header": [
      {
        "type": "text",
        "text": "string",
        "example": {
          "text": "John Doe"
        }
      }
    ],
    "body": [
      {
        "type": "text",
        "text": "string",
        "example": {
          "texts": [
            "John Doe",
            "Order ID 123"
          ]
        }
      }
    ],
    "button": [
      {
        "type": "quick_reply",
        "index": 0,
        "payload": "string"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
templateId string true none none
templateLanguage string true none none
components WhatsAppTemplateComponents false none none

WhatsAppTemplateComponents

{
  "header": [
    {
      "type": "text",
      "text": "string",
      "example": {
        "text": "John Doe"
      }
    }
  ],
  "body": [
    {
      "type": "text",
      "text": "string",
      "example": {
        "texts": [
          "John Doe",
          "Order ID 123"
        ]
      }
    }
  ],
  "button": [
    {
      "type": "quick_reply",
      "index": 0,
      "payload": "string"
    }
  ]
}

Properties

Name Type Required Restrictions Description
header [oneOf] false none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateTextHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateImageHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateVideoHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateDocumentHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateLocationHeaderComponent false none none

continued

Name Type Required Restrictions Description
body [WhatsAppTemplateTextBodyComponent] false none [Body parameter replacement of a template]
button any false none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppQuickReplyButtons false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppCallToActionButtons false none none

WhatsAppTemplateTextHeaderComponent

{
  "type": "text",
  "text": "string",
  "example": {
    "text": "John Doe"
  }
}

Properties

Name Type Required Restrictions Description
type string true none none
text string true none none
example WhatsAppTemplateTextHeaderComponentExample true none An example of the header text
Enumerated values
Property Value
type text

WhatsAppTemplateTextHeaderComponentExample

{
  "text": "John Doe"
}

An example of the header text

Properties

Name Type Required Restrictions Description
text string false none Example text

WhatsAppTemplateImageHeaderComponent

{
  "type": "image",
  "image": {
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

Properties

Name Type Required Restrictions Description
type string true none none
image WhatsAppTemplateMediaHeader true none Media header specification
Enumerated values
Property Value
type image

WhatsAppTemplateVideoHeaderComponent

{
  "type": "video",
  "video": {
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

Properties

Name Type Required Restrictions Description
type string true none none
video WhatsAppTemplateMediaHeader true none Media header specification
Enumerated values
Property Value
type video

WhatsAppTemplateDocumentHeaderComponent

{
  "type": "document",
  "document": {
    "filename": "Test PDF",
    "url": "string",
    "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
  }
}

Properties

Name Type Required Restrictions Description
type string true none none
document WhatsAppTemplateDocumentHeader true none Document media specification
Enumerated values
Property Value
type document

WhatsAppTemplateLocationHeaderComponent

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

Properties

Name Type Required Restrictions Description
type string true none none
location WhatsAppLocation true none Location received or send
Enumerated values
Property Value
type location

WhatsAppTemplateMediaHeader

{
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

Media header specification

Properties

None

WhatsAppTemplateDocumentHeader

{
  "filename": "Test PDF",
  "url": "string",
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad"
}

Document media specification

Properties

Name Type Required Restrictions Description
filename string false none Additional info for the filename to be displayed.

WhatsAppTemplateTextBodyComponent

{
  "type": "text",
  "text": "string",
  "example": {
    "texts": [
      "John Doe",
      "Order ID 123"
    ]
  }
}

Body parameter replacement of a template

Properties

Name Type Required Restrictions Description
type string true none none
text string true none none
example WhatsAppTemplateTextBodyComponentExample true none Examples of the body parameters.
Enumerated values
Property Value
type text

WhatsAppTemplateTextBodyComponentExample

{
  "texts": [
    "John Doe",
    "Order ID 123"
  ]
}

Examples of the body parameters.

Properties

Name Type Required Restrictions Description
texts [string] false none Examples of the body parameters

WhatsAppQuickReplyButtons

[
  {
    "type": "quick_reply",
    "index": 0,
    "payload": "string"
  }
]

Properties

Name Type Required Restrictions Description
anonymous [QuickReplyButtonComponent] false none [This type can be used up to three times]

WhatsAppCallToActionButtons

[
  {
    "type": "url",
    "index": 0,
    "text": "string"
  }
]

Properties

Name Type Required Restrictions Description
anonymous [UrlButtonComponent] false none [This type can be used up to one time]

QuickReplyButtonComponent

{
  "type": "quick_reply",
  "index": 0,
  "payload": "string"
}

This type can be used up to three times

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the button. Always quick_reply.
index number true none Determines the index of the button that should be enhanced with the payload.
payload string true none A payload for this quick reply button. Sent back on the MoMessage::PostBack event
Enumerated values
Property Value
type quick_reply

UrlButtonComponent

{
  "type": "url",
  "index": 0,
  "text": "string"
}

This type can be used up to one time

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the button. Always url.
index number true none Determines the index of the button that should be enhanced with a custom parameter
text string true none Which text should be appended to a dynamic URL. Note the requested templates url button must end with {{1}}.
Enumerated values
Property Value
type url

WhatsAppInteractiveButtonMessage

{
  "subType": "buttons",
  "components": {
    "header": {
      "type": "text",
      "text": "Your request is queued"
    },
    "body": {
      "type": "text",
      "text": "How would you rate your bot experience"
    },
    "footer": {
      "type": "text",
      "text": "Your service bot"
    },
    "buttons": [
      {
        "type": "reply",
        "reply": {
          "payload": "987298-40980jvkdm9-234234234",
          "title": "Poor"
        }
      },
      {
        "type": "reply",
        "reply": {
          "payload": "987298-dsfgjlkhgdf-dg09u834334",
          "title": "OK"
        }
      },
      {
        "type": "reply",
        "reply": {
          "payload": "9080923445nlkjß0_gß0923845083245dfg",
          "title": "Good"
        }
      }
    ]
  }
}

An interactive message type

Properties

Name Type Required Restrictions Description
subType string false none none
components WhatsAppInteractiveButtonComponents true none none
Enumerated values
Property Value
subType buttons

WhatsAppInteractiveListMessage

{
  "subType": "list",
  "components": {
    "header": {
      "type": "text",
      "text": "Choose your menu"
    },
    "body": {
      "type": "text",
      "text": "Hi Sarah, select your menu from the bottom list. Dressings and toppings are selected later on"
    },
    "footer": {
      "type": "text",
      "text": "Your tyntec food team"
    },
    "list": {
      "title": "Your menu",
      "sections": [
        {
          "title": "Vegan",
          "rows": [
            {
              "title": "Green dream",
              "payload": "green-dream-34987-234897234-234",
              "description": "A bowl full of tasty leaves, soy beans and cucumber"
            },
            {
              "title": "Rainbow meets rice",
              "payload": "rainbow-meets-rice-34987-234897234-234",
              "description": "A colorful selection of vegetables on a cozy bed of basmati rice"
            }
          ]
        },
        {
          "title": "Vegetarian",
          "rows": [
            {
              "title": "Italo Classic",
              "payload": "italo-classic-34987-234897234-234",
              "description": "Slices of tomatoes with plucked pieces of mozzarella and basil leaves"
            },
            {
              "title": "Egg & Peas",
              "payload": "egg-and-peas-34987-234897234-234",
              "description": "Tasty slices of eggs on a whole wheat pasta salad with peas"
            }
          ]
        }
      ]
    }
  }
}

An interactive message type

Properties

Name Type Required Restrictions Description
subType string true none none
components WhatsAppInteractiveListComponents true none A list message component. It can have at most 10 rows distributed over at most 10 sections
Enumerated values
Property Value
subType list

WhatsAppInteractiveProductMessage

{
  "subType": "product",
  "components": {
    "header": {
      "type": "text",
      "text": "What about?"
    },
    "body": {
      "type": "text",
      "text": "According to your query, we found this matching product"
    },
    "footer": {
      "type": "text",
      "text": "Your service bot"
    },
    "product": {
      "catalogId": 123987987498123,
      "productId": "My-Product-SKU"
    }
  }
}

Interactive Product Message

Properties

Name Type Required Restrictions Description
subType string false none Determines the type of interactive message. Always product
components WhatsAppInteractiveProductComponents true none An interactive Product Component
Enumerated values
Property Value
subType product

WhatsAppInteractiveProductListMessage

{
  "subType": "productList",
  "components": {
    "header": {
      "type": "text",
      "text": "What about?"
    },
    "body": {
      "type": "text",
      "text": "According to your query, we found this matching products"
    },
    "footer": {
      "type": "text",
      "text": "Your service bot"
    },
    "productList": {
      "catalogId": 12314123123,
      "sections": [
        {
          "title": "Vegan",
          "items": [
            {
              "productId": "sku-1"
            },
            {
              "productId": "sku-2"
            }
          ]
        },
        {
          "title": "Vegetarian",
          "items": [
            {
              "productId": "sku-3"
            },
            {
              "productId": "sku-4"
            }
          ]
        }
      ]
    }
  }
}

Interactive Product List Message

Properties

Name Type Required Restrictions Description
subType string false none Determines the type of interactive message. Always productList
components WhatsAppInteractiveProductListComponents true none A Product List message component. It can have at most 30 products distributed over at most 10 sections
Enumerated values
Property Value
subType productList

WhatsAppInteractiveButtonComponents

{
  "header": {
    "type": "text",
    "text": "string",
    "example": {
      "text": "John Doe"
    }
  },
  "body": {
    "type": "text",
    "text": "string"
  },
  "footer": {
    "type": "text",
    "text": "string"
  },
  "buttons": [
    {
      "type": "reply",
      "reply": {
        "payload": "string",
        "title": "string"
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
header any false none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateTextHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateImageHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateVideoHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateDocumentHeaderComponent false none none

continued

Name Type Required Restrictions Description
body WhatsAppInteractiveTextContent true none The message body of an interactive message
footer WhatsAppInteractiveFooterContent false none The footer of an interactive message
buttons [WhatsAppInteractiveButton] true none [An interactive message button]

WhatsAppInteractiveButton

{
  "type": "reply",
  "reply": {
    "payload": "string",
    "title": "string"
  }
}

An interactive message button

Properties

Name Type Required Restrictions Description
type string true none The type of button. Always "reply"
reply object true none The reply button specification
» payload string true none The ID of the reply button. Must be unique within the same messaging request
» title string true none The caption or title of the button
Enumerated values
Property Value
type reply

WhatsAppInteractiveListComponents

{
  "header": {
    "type": "text",
    "text": "string",
    "example": {
      "text": "John Doe"
    }
  },
  "body": {
    "type": "text",
    "text": "string"
  },
  "footer": {
    "type": "text",
    "text": "string"
  },
  "list": {
    "title": "Choose from this list",
    "sections": [
      {
        "title": "string",
        "rows": [
          {
            "payload": "string",
            "title": "string",
            "description": "string"
          }
        ]
      }
    ]
  }
}

A list message component. It can have at most 10 rows distributed over at most 10 sections

Properties

Name Type Required Restrictions Description
header WhatsAppTemplateTextHeaderComponent false none none
body WhatsAppInteractiveTextContent true none The message body of an interactive message
footer WhatsAppInteractiveFooterContent false none The footer of an interactive message
list WhatsAppInteractiveListContent true none A definition of a WhatsApp interactive list

WhatsAppInteractiveListContent

{
  "title": "Choose from this list",
  "sections": [
    {
      "title": "string",
      "rows": [
        {
          "payload": "string",
          "title": "string",
          "description": "string"
        }
      ]
    }
  ]
}

A definition of a WhatsApp interactive list

Properties

Name Type Required Restrictions Description
title string true none none
sections [WhatsAppListSection] true none Sections of the list message

WhatsAppListSection

{
  "title": "string",
  "rows": [
    {
      "payload": "string",
      "title": "string",
      "description": "string"
    }
  ]
}

A section of a list message.

Properties

Name Type Required Restrictions Description
title string false none The title of the section mandatory in case of multiple sections
rows [WhatsAppListSectionRow] true none Items of the section

WhatsAppListSectionRow

{
  "payload": "string",
  "title": "string",
  "description": "string"
}

A row item of a list message

Properties

Name Type Required Restrictions Description
payload string true none The ID of the item, must be unique within the request
title string true none The caption of the item in the list
description string false none An optional description of the item

WhatsAppInteractiveProductComponents

{
  "body": {
    "type": "text",
    "text": "string"
  },
  "footer": {
    "type": "text",
    "text": "string"
  },
  "product": {
    "catalogId": "12432134",
    "productId": "Test SKU"
  }
}

An interactive Product Component

Properties

Name Type Required Restrictions Description
body WhatsAppInteractiveTextContent true none The message body of an interactive message
footer WhatsAppInteractiveFooterContent false none The footer of an interactive message
product object true none A product specification to be sent to the customer
» catalogId string true none The Catalog ID of the Facebook catalog, must be linked to the WhatsApp business account
» productId string true none The Own Product ID or SKU for the product. Must be configured on the Facebook catalog

WhatsAppInteractiveProductListComponents

{
  "header": {
    "type": "text",
    "text": "string",
    "example": {
      "text": "John Doe"
    }
  },
  "body": {
    "type": "text",
    "text": "string"
  },
  "footer": {
    "type": "text",
    "text": "string"
  },
  "productList": {
    "catalogId": 2134432423,
    "sections": [
      {
        "title": "string",
        "items": [
          {
            "productId": "Test SKU"
          }
        ]
      }
    ]
  }
}

A Product List message component. It can have at most 30 products distributed over at most 10 sections

Properties

Name Type Required Restrictions Description
header WhatsAppTemplateTextHeaderComponent true none none
body WhatsAppInteractiveTextContent true none The message body of an interactive message
footer WhatsAppInteractiveFooterContent false none The footer of an interactive message
productList WhatsAppInteractiveProductListContent true none The definition of a WhatsApp product list

WhatsAppInteractiveProductListContent

{
  "catalogId": 2134432423,
  "sections": [
    {
      "title": "string",
      "items": [
        {
          "productId": "Test SKU"
        }
      ]
    }
  ]
}

The definition of a WhatsApp product list

Properties

Name Type Required Restrictions Description
catalogId string false none The Catalog ID of the Facebook catalog, must be linked to the WhatsApp business account
sections [WhatsAppProductListSection] true none Sections of the list message

WhatsAppProductListSection

{
  "title": "string",
  "items": [
    {
      "productId": "Test SKU"
    }
  ]
}

A section of a product list message.

Properties

Name Type Required Restrictions Description
title string false none The title of the section mandatory in case of multiple sections
items [WhatsAppProductListItem] true none Products of this section

WhatsAppProductListItem

{
  "productId": "Test SKU"
}

A single item on the product list

Properties

Name Type Required Restrictions Description
productId string true none The Own Product ID or SKU for the product. Must be configured on the Facebook catalog

WhatsAppProfile

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

The current profile of a WhatsApp number.

Properties

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

WhatsAppMessageStatusUpdate

{
  "status": "read"
}

A change in the message status of a previously sent WhatsApp message

Properties

Name Type Required Restrictions Description
status string false none WhatsApp message status
Enumerated values
Property Value
status read
{
  "link": "https://pps.whatsapp.net/v/123123"
}

A link to the profile logo

Properties

Name Type Required Restrictions Description
link string true none The link to the profile logo

WhatsAppAccounts

[
  {
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "whatsAppAccountName": "Swagger Sample Account",
    "businessName": "Swagger Sample business",
    "templateNamespace": "c9468969-a3a3-4c17-95f7-1e8b2902ed74",
    "facebookBusinessManagerId": 1791147717848878,
    "accountStatus": {
      "messageOnBehalf": "PENDING"
    },
    "managedBy": {
      "accountName": "tynteccpaas"
    }
  }
]

A list of WhatsApp Business Accounts. Might be empty

Properties

Name Type Required Restrictions Description
anonymous [WhatsAppAccount] false none A list of WhatsApp Business Accounts. Might be empty

WhatsAppAccount

{
  "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
  "whatsAppAccountName": "Swagger Sample Account",
  "businessName": "Swagger Sample business",
  "templateNamespace": "c9468969-a3a3-4c17-95f7-1e8b2902ed74",
  "facebookBusinessManagerId": 1791147717848878,
  "accountStatus": {
    "messageOnBehalf": "PENDING"
  },
  "managedBy": {
    "accountName": "tynteccpaas"
  }
}

A WhatsApp Business Account

Properties

Name Type Required Restrictions Description
whatsAppAccountId string(uuid) true none The ID of the WhatsApp Business Account
whatsAppAccountName string false none The name of the WhatsApp Business Account
businessName string false none The name of the business owning the Facebook Business Manager
templateNamespace string false none A template namespace assigned to the WhatsApp Business Account.

This is used internally and here stated for completeness.
facebookBusinessManagerId number false none The Facebook Business Manager ID provided by Facebook
whatsAppBusinessAccountId string false none The WhatsApp Business Account ID provided by WhatsApp
accountStatus WhatsAppAccountStatus false none Status information for the WhatsApp account
managedBy CPaaSAccount false none The account that can manage (edit, ...) the entity

WhatsAppPhoneNumbers

[
  {
    "phoneNumber": "49123456789",
    "displayPhoneNumber": "+49 123 45678",
    "verifiedName": "Swagger Sample",
    "qualityRating": "YELLOW",
    "status": "FLAGGED",
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "managedBy": {
      "accountName": "tyntecscpaas"
    },
    "messagingVia": {
      "accountName": "messagingcpaas"
    },
    "nameStatus": "APPROVED",
    "isOfficialBusinessAccount": false
  }
]

A list of phone numbers on WhatsApp. Might be empty

Properties

Name Type Required Restrictions Description
anonymous [WhatsAppPhoneNumber] false none A list of phone numbers on WhatsApp. Might be empty

WhatsAppPhoneNumber

{
  "phoneNumber": "49123456789",
  "displayPhoneNumber": "+49 123 45678",
  "verifiedName": "Swagger Sample",
  "qualityRating": "YELLOW",
  "status": "FLAGGED",
  "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
  "managedBy": {
    "accountName": "tyntecscpaas"
  },
  "messagingVia": {
    "accountName": "messagingcpaas"
  },
  "nameStatus": "APPROVED",
  "isOfficialBusinessAccount": false
}

A phone number assigned to a WhatsApp Business Account

Properties

Name Type Required Restrictions Description
phoneNumber string false none The phone number
displayPhoneNumber string false none The phone number as it is displayed in the app
verifiedName string false none The name shown next to the number.

This name will be shown immediately for Official Business Accounts.
qualityRating string false none The current quality rating of the phone number.

A RED rating will lead to the flagged status if the number keeps receiving
negative feedback from users.
status string false none The status of the number
whatsAppAccountId string(uuid) false none The ID of the WhatsApp Business Account the number belongs to.
managedBy CPaaSAccount false none The account that can manage (edit, ...) the entity
messagingVia CPaaSAccount false none The account that must be used for messaging
messagingTier string false none Which messaging tier the number is currently on
qualityScore QualityScore false none The quality score provided by WhatsApp and calculated from user feedback on your messages
nameStatus string false none Status of Display Name approval by Meta
isOfficialBusinessAccount boolean false none True if this phone number is recognized as official business account by Meta (green checkmark badge)
Enumerated values
Property Value
qualityRating GREEN
qualityRating RED
qualityRating YELLOW
status CONNECTED
status PENDING
status FLAGGED
status RESTRICTED
status OFFLINE
status DISCONNECTED
messagingTier TIER_NOT_SET
messagingTier TIER_50
messagingTier TIER_250
messagingTier TIER_1K
messagingTier TIER_10K
messagingTier TIER_100K
messagingTier UNLIMITED

CPaaSAccount

{
  "accountName": "someaccount"
}

The CPaaS account behind the API key

Properties

Name Type Required Restrictions Description
accountName string false none The name of the CPaaSAccount

WhatsAppTemplateRequest

{
  "name": "string",
  "category": "MARKETING",
  "localizations": [
    {
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "text": "string"
        }
      ]
    }
  ],
  "allowCategoryChange": false
}

A request for an additional WhatsApp template

Properties

Name Type Required Restrictions Description
name string true none The name of the template
category TemplateCategory true none The category of the template
localizations [LocalizationRequest] true none Localizations of the template
allowCategoryChange boolean false none If true, let Meta allow to change category

LocalizationRequest

{
  "language": "en",
  "components": [
    {
      "type": "BODY",
      "text": "string"
    }
  ]
}

A request for a new localization of a template

Properties

Name Type Required Restrictions Description
language LanguageCode true none The supported language codes, according to Supported Languages
components any true none Components defining the template

oneOf

Name Type Required Restrictions Description
» anonymous NotificationTemplateRequest false none A request for a standard template (notification) without rich media components

xor

Name Type Required Restrictions Description
» anonymous RichMediaTemplateRequest false none A rich media template definition. Must contain at least the body component

NotificationTemplateRequest

[
  {
    "type": "BODY",
    "text": "string"
  }
]

A request for a standard template (notification) without rich media components

Properties

Name Type Required Restrictions Description
type string true none The template component type. Always BODY
text string true none Template text (1--1024 chars)
Enumerated values
Property Value
type BODY

RichMediaTemplateRequest

[
  {
    "type": "HEADER",
    "format": "TEXT",
    "text": "Hi {{1}}",
    "example": {
      "text": "John Doe"
    }
  }
]

A rich media template definition. Must contain at least the body component

Properties

anyOf

Name Type Required Restrictions Description
anonymous WhatsAppTemplateHeaderComponentRequest false none A header component of a template

or

Name Type Required Restrictions Description
anonymous WhatsAppTemplateBodyComponentRequest false none A body component of a template

or

Name Type Required Restrictions Description
anonymous WhatsAppTemplateFooterComponentRequest false none A footer component of a template

or

Name Type Required Restrictions Description
anonymous WhatsAppTemplateButtonComponentRequest false none A button component of a template

WhatsAppTemplateHeaderComponentRequest

{
  "type": "HEADER",
  "format": "TEXT",
  "text": "Hi {{1}}",
  "example": {
    "text": "John Doe"
  }
}

A header component of a template

Properties

oneOf

Name Type Required Restrictions Description
anonymous WhatsAppTemplateTextHeaderComponentRequest false none A text header component of a template

xor

Name Type Required Restrictions Description
anonymous WhatsAppTemplateMediaHeaderComponentRequest false none A media header component of a template

xor

Name Type Required Restrictions Description
anonymous WhatsAppTemplateLocationHeaderComponentRequest false none A location header component of a template

WhatsAppTemplateTextHeaderComponentRequest

{
  "type": "HEADER",
  "format": "TEXT",
  "text": "Hi {{1}}",
  "example": {
    "text": "John Doe"
  }
}

A text header component of a template

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the component. Always HEADER
format string true none What kind of header
text string true none The text that should be displayed as the header. Can contain 1 variable
example WhatsAppTemplateTextHeaderComponentRequestExample true none An example of the header text
Enumerated values
Property Value
type HEADER
format TEXT

WhatsAppTemplateTextHeaderComponentRequestExample

{
  "text": "John Doe"
}

An example of the header text

Properties

Name Type Required Restrictions Description
text string false none An example text

WhatsAppTemplateLocationHeaderComponentRequest

{
  "type": "HEADER",
  "format": "LOCATION"
}

A location header component of a template

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the component. Always HEADER
format string true none What kind of header
Enumerated values
Property Value
type HEADER
format LOCATION

WhatsAppTemplateMediaHeaderComponentRequest

{
  "type": "HEADER",
  "format": "IMAGE",
  "example": {
    "url": "https://www.my.com/image.jpg"
  }
}

A media header component of a template

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the component. Always HEADER
format string true none What kind of header
example WhatsAppTemplateMediaHeaderComponentRequestExample true none An example of a media
Enumerated values
Property Value
type HEADER
format IMAGE
format DOCUMENT
format VIDEO

WhatsAppTemplateMediaHeaderComponentRequestExample

{
  "url": "https://www.my.com/image.jpg"
}

An example of a media

Properties

Name Type Required Restrictions Description
url string false none The URL of the example media file

WhatsAppTemplateBodyComponentRequest

{
  "type": "BODY",
  "text": "Hi {{1}}, your order {{2}} is shipped",
  "example": {
    "texts": [
      "John Doe",
      123
    ]
  }
}

A body component of a template

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the component. Always BODY
text string false none The specification of the body text (1--1024 chars). Mandatory for all non-authentication templates
addSecurityRecommendation boolean false none Only used for AUTHENTICATION templates. Adds security recommendation to the default OTP text.
example WhatsAppTemplateBodyComponentRequestExample false none Examples of body parameters. All parameters of the body must have an example
Enumerated values
Property Value
type BODY

WhatsAppTemplateBodyComponentRequestExample

{
  "texts": [
    "John Doe",
    "Order ID 123"
  ]
}

Examples of body parameters. All parameters of the body must have an example

Properties

Name Type Required Restrictions Description
texts [string] true none Examples of body parameters

WhatsAppTemplateFooterComponentRequest

{
  "type": "FOOTER",
  "text": "The specification team",
  "codeExpirationMinutes": 0
}

A footer component of a template

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the component
text string false none The specification of the footer text (1--60 chars). Mandatory for all non-authentication templates
codeExpirationMinutes integer false none Only used in AUTHENTICATION templates. Adds an expiration note to the default OTP text.
Enumerated values
Property Value
type FOOTER

WhatsAppTemplateButtonComponentRequest

{
  "type": "BUTTONS",
  "buttons": [
    {
      "type": "QUICK_REPLY",
      "text": "I liked it!"
    }
  ]
}

A button component of a template

Properties

Name Type Required Restrictions Description
type string true none Determines the type of the component
buttons any true none none

oneOf

Name Type Required Restrictions Description
» anonymous WhatsAppQuickReplyButtonsRequest false none Quick Reply buttons

xor

Name Type Required Restrictions Description
» anonymous WhatsAppCallToActionButtonsRequest false none Call to action buttons. At most one of each button type can be used.

xor

Name Type Required Restrictions Description
» anonymous WhatsAppOtpButtonsRequest false none OTP buttons
Enumerated values
Property Value
type BUTTONS

WhatsAppQuickReplyButtonsRequest

[
  {
    "type": "QUICK_REPLY",
    "text": "I liked it!"
  }
]

Quick Reply buttons

Properties

Name Type Required Restrictions Description
anonymous [WhatsAppQuickReplyButton] false none Quick Reply buttons

WhatsAppQuickReplyButton

{
  "type": "QUICK_REPLY",
  "text": "I liked it!"
}

A quick reply button, when clicked the caption and the dynamic payload are returned.

Properties

Name Type Required Restrictions Description
type string true none The type of this button
text string true none The caption of the button
Enumerated values
Property Value
type QUICK_REPLY

WhatsAppOtpButtonsRequest

[
  {
    "type": "OTP",
    "otpType": "COPY_CODE",
    "text": "Copy code."
  }
]

OTP buttons

Properties

anyOf

Name Type Required Restrictions Description
anonymous WhatsAppCopyCodeOtpButton false none A copy code button. When clicked, the code is copied to handsets clipboard.

or

Name Type Required Restrictions Description
anonymous WhatsAppOneTapOtpButton false none A one-tap otp button. Only works for android at the moment, see https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates#handshake

WhatsAppCopyCodeOtpButton

{
  "type": "OTP",
  "otpType": "COPY_CODE",
  "text": "Copy code."
}

A copy code button. When clicked, the code is copied to handsets clipboard.

Properties

Name Type Required Restrictions Description
type string true none The type of this button, 'OTP'
otpType string true none The subtype of this button, 'COPY_CODE'
text string true none The caption of the copy code button.
Enumerated values
Property Value
type OTP
otpType COPY_CODE

WhatsAppOneTapOtpButton

{
  "type": "OTP",
  "otpType": "ONE_TAP",
  "text": "Copy code.",
  "autofillText": "Autofill",
  "packageName": "string",
  "signatureHash": "string"
}

A one-tap otp button. Only works for android at the moment, see https://developers.facebook.com/docs/whatsapp/business-management-api/authentication-templates#handshake

Properties

Name Type Required Restrictions Description
type string true none The type of this button, 'OTP'
otpType string true none The subtype of this button, 'ONE_TAP'
text string true none The caption of the fallback copy code button, if one-tap is not available.
autofillText string true none The caption of the autofill button.
packageName string true none Your android app's package name.
signatureHash string true none Your app signing key hash.
Enumerated values
Property Value
type OTP
otpType ONE_TAP

WhatsAppCallToActionButtonsRequest

[
  {
    "type": "URL",
    "text": "Your invoice",
    "url": "https://www.myservice.com/invoices/{{1}}",
    "example": {
      "url": "https://www.myservice.com/invoices/9424a5c5-9089-4142-9cd2-0365383ce387.pdf"
    }
  }
]

Call to action buttons. At most one of each button type can be used.

Properties

anyOf

Name Type Required Restrictions Description
anonymous WhatsAppURLButton false none A call to action button that opens the specified URL when clicked

or

Name Type Required Restrictions Description
anonymous WhatsAppPhoneNumberButton false none A call to action button that initiates a call when clicked

WhatsAppURLButton

{
  "type": "URL",
  "text": "Your invoice",
  "url": "https://www.myservice.com/invoices/{{1}}",
  "example": {
    "url": "https://www.myservice.com/invoices/9424a5c5-9089-4142-9cd2-0365383ce387.pdf"
  }
}

A call to action button that opens the specified URL when clicked

Properties

Name Type Required Restrictions Description
type string true none The type of this button
text string true none The caption of the button
url string false none The URL that will be openend when clicking on the button. Can contain 1 parameter at the end.
example WhatsAppURLButtonExample true none An example of a dynamic URL button.
Enumerated values
Property Value
type URL

WhatsAppURLButtonExample

{
  "url": "https://www.myservice.com/invoices/9424a5c5-9089-4142-9cd2-0365383ce387.pdf"
}

An example of a dynamic URL button.

Properties

Name Type Required Restrictions Description
url string false none An example of a dynamic URL button. Must start with the same base url as the url button

WhatsAppPhoneNumberButton

{
  "type": "PHONE_NUMBER",
  "text": "Call us",
  "phoneNumber": "+4923147790813"
}

A call to action button that initiates a call when clicked

Properties

Name Type Required Restrictions Description
type string true none The type of this button
text string true none The caption for this button
phoneNumber string false none The phone number that will be called when clicking on the button.
Enumerated values
Property Value
type PHONE_NUMBER

WhatsAppTemplates

[
  {
    "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
    "templateName": "swagger_test",
    "category": "MARKETING",
    "localizations": [
      {
        "status": "REJECTED",
        "rejectionReason": "For this example",
        "language": "en",
        "components": [
          {
            "type": "BODY",
            "text": "Hello {{1}}! How is going?"
          },
          {
            "type": "FOOTER",
            "text": "Your specification team!"
          }
        ]
      }
    ]
  }
]

A list of WhatsApp templates

Properties

Name Type Required Restrictions Description
anonymous [WhatsAppTemplateResponse] false none A list of WhatsApp templates

WhatsAppTemplateResponse

{
  "whatsAppAccountId": "5637b8a7-51e1-47be-ad0b-b242453dcc1b",
  "templateName": "swagger_test",
  "category": "MARKETING",
  "localizations": [
    {
      "status": "REJECTED",
      "rejectionReason": "For this example",
      "language": "en",
      "components": [
        {
          "type": "BODY",
          "text": "Hello {{1}}! How is going?"
        },
        {
          "type": "FOOTER",
          "text": "Your specification team!"
        }
      ]
    }
  ]
}

A WhatsApp template

Properties

Name Type Required Restrictions Description
whatsAppAccountId string(uuid) false none The ID of the WhatsApp Business Account the template belongs to.
templateName string false none The name of the template
templateId string false none The ID of the template
category TemplateCategory false none The category of the template
localízations [LocalizationResponse] false none The list of localizations of this template

LocalizationResponse

{
  "status": "DELETED",
  "rejectionReason": "not yet",
  "language": "en",
  "components": [
    {
      "type": "BODY",
      "text": "Hello {{1}}! How is going?"
    }
  ],
  "createdAt": "2020-02-15T23:28:34.442Z",
  "lastUpdated": "2020-02-15T25:28:34.442Z",
  "expiresAt": "2020-03-15T23:28:34.442Z",
  "qualityScore": {
    "score": "RED",
    "reasons": [
      "Users are choosing \"didn't sign up\" as a reason for blocking this phone number. Businesses must obtain opt-in before sending notifications. Please review your opt-in flow(s) and see our Business Policy for more detail."
    ]
  }
}

A localization of a template

Properties

Name Type Required Restrictions Description
status string true none The status of the localization.
rejectionReason string false none The descriptive text in the case the status is REJECTED
language LanguageCode true none The supported language codes, according to Supported Languages
components [anyOf] true none A set of components defining a template

anyOf

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateHeaderComponentResponse false none A header component of a template

or

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateBodyComponentResponse false none A body component of a template

or

Name Type Required Restrictions Description
» anonymous WhatsAppTemplateFooterComponentResponse false none A footer component of a template

continued

Name Type Required Restrictions Description
createdAt string(date-time) true none At which point in time the template was created
lastUpdated string(date-time) true none At which point in time the last update happened
expiresAt string(date-time) false none When the localization expires.
Only present when a template was deleted.
qualityScore QualityScore false none The quality score provided by WhatsApp and calculated from user feedback on your messages
Enumerated values
Property Value
status REQUESTED
status SUBMIT_FAILED
status PENDING
status APPROVED
status REJECTED
status DELETION_PENDING
status DELETED
status SUBMITTED

WhatsAppTemplateHeaderComponentResponse

{
  "type": "HEADER",
  "format": "IMAGE",
  "text": "Hi {{1}}!"
}

A header component of a template

Properties

Name Type Required Restrictions Description
type string true none A component type
format string true none What kind of header
text string false none The textual part in the case the format is TEXT
Enumerated values
Property Value
type HEADER
format IMAGE
format TEXT
format DOCUMENT
format VIDEO

WhatsAppTemplateBodyComponentResponse

{
  "type": "BODY",
  "text": "Hi {{1}}! Enjoy the spec!"
}

A body component of a template

Properties

Name Type Required Restrictions Description
type string true none A component type
text string true none The specification of the body text
Enumerated values
Property Value
type BODY

WhatsAppTemplateFooterComponentResponse

{
  "type": "FOOTER",
  "text": "The specification team"
}

A footer component of a template

Properties

Name Type Required Restrictions Description
type string true none A component type
text string false none The specification of the footer text
Enumerated values
Property Value
type FOOTER

TemplateCategory

"MARKETING"

The category of the template

Properties

Name Type Required Restrictions Description
anonymous string false none The category of the template
Enumerated values
Property Value
anonymous MARKETING
anonymous UTILITY
anonymous AUTHENTICATION

LanguageCode

"en"

The supported language codes, according to Supported Languages

Properties

Name Type Required Restrictions Description
anonymous string false none The supported language codes, according to Supported Languages
Enumerated values
Property Value
anonymous af
anonymous ar
anonymous az
anonymous bg
anonymous bn
anonymous ca
anonymous cs
anonymous da
anonymous de
anonymous el
anonymous en
anonymous en_GB
anonymous en_US
anonymous es
anonymous es_AR
anonymous es_ES
anonymous es_MX
anonymous et
anonymous fa
anonymous fi
anonymous fil
anonymous fr
anonymous ga
anonymous gu
anonymous ha
anonymous he
anonymous hi
anonymous hr
anonymous hu
anonymous ID
anonymous it
anonymous ja
anonymous kk
anonymous kn
anonymous ko
anonymous lo
anonymous lt
anonymous lv
anonymous mk
anonymous ml
anonymous mr
anonymous ms
anonymous nb
anonymous nl
anonymous pa
anonymous pl
anonymous pt_BR
anonymous pt_PT
anonymous ro
anonymous ru
anonymous sk
anonymous sl
anonymous sq
anonymous sr
anonymous sv
anonymous sw
anonymous ta
anonymous te
anonymous th
anonymous tr
anonymous uk
anonymous ur
anonymous uz
anonymous vi
anonymous zh_CN
anonymous zh_HK
anonymous zh_TW
anonymous zu

WhatsAppAccountStatus

{
  "messageOnBehalf": "APPROVED"
}

Status information for the WhatsApp account

Properties

Name Type Required Restrictions Description
messageOnBehalf string false none Indicates the status of a message on behalf request
Enumerated values
Property Value
messageOnBehalf PENDING
messageOnBehalf APPROVED
messageOnBehalf DENIED

PaginationLinkRelation

"first"

What kind of relation is this link.

The relations are defined as follows:

  • first – The first page in the resource list pagination
  • previous – The preceding page in the resource list pagination
  • current – The current page in the resource list pagination
  • next – The following page in the resource list pagination
  • last – The last page in the resource list pagination

Properties

Name Type Required Restrictions Description
anonymous string false none What kind of relation is this link.

The relations are defined as follows:

- first – The first page in the resource list pagination
- previous – The preceding page in the resource list pagination
- current – The current page in the resource list pagination
- next – The following page in the resource list pagination
- last – The last page in the resource list pagination
Enumerated values
Property Value
anonymous first
anonymous previous
anonymous current
anonymous next
anonymous last

WhatsAppChannelResponse

{
  "channel": "whatsapp",
  "scopes": [
    "messages:read",
    "profile:read",
    "callbacks:write",
    "callbacks:read"
  ],
  "id": {
    "phoneNumber": "12341234"
  },
  "callback": {
    "callbackVersion": "2.11",
    "inboundMessageUrl": "https://your.server.com/inbound",
    "messageStatusUrl": "https://your.server.com/status",
    "eventFilter": [
      "MessageStatus::accepted",
      "MessageStatus::delivered"
    ]
  }
}

Properties

Name Type Required Restrictions Description
id object false none The definition of the Phone Number Id
» phoneNumber string false none none

WhatsAppChannelResponses

[
  {
    "channel": "whatsapp",
    "scopes": [
      "messages:read",
      "profile:read",
      "callbacks:write",
      "callbacks:read"
    ],
    "id": {
      "phoneNumber": "12341234"
    },
    "callback": {
      "callbackVersion": "2.11",
      "inboundMessageUrl": "https://your.server.com/inbound",
      "messageStatusUrl": "https://your.server.com/status",
      "eventFilter": [
        "MessageStatus::accepted",
        "MessageStatus::delivered"
      ]
    }
  }
]

Properties

Name Type Required Restrictions Description
id object false none The definition of the Phone Number Id
» phoneNumber string false none none

ChannelCallback

{
  "callbackVersion": "2.11",
  "inboundMessageUrl": "string",
  "messageStatusUrl": "string",
  "eventFilter": []
}

A configuration of callbacks to your system

Properties

Name Type Required Restrictions Description
callbackVersion string false none The event version to be used.
inboundMessageUrl string false none A webhook for events related to inbound messages
messageStatusUrl string false none A webhook for events related to message status changes
eventFilter [string] false none A list of status events to listen to. If empty, all events are submitted.
Enumerated values
Property Value
callbackVersion 2.11

QualityScore

{
  "score": "RED",
  "reasons": [
    "Users are choosing \"didn't sign up\" as a reason for blocking this phone number. Businesses must obtain opt-in before sending notifications. Please review your opt-in flow(s) and see our Business Policy for more detail."
  ]
}

The quality score provided by WhatsApp and calculated from user feedback on your messages

Properties

Name Type Required Restrictions Description
score string true none The current scoring
reasons [string] false none A textual description of why the quality score is set to the value.
Only present when the score is YELLOW or RED
Enumerated values
Property Value
score unknown
score GREEN
score YELLOW
score RED

Viber

Version: v3.2

Specification Release Notes Other versions

The Conversations API allows you to easily send messages to your customers via Viber.

Channel specific pre-conditions

  • Viber : A Viber Service id is required in order to use this channel. Please request access here

Viber defines different rate types and capabilities. The rate types limit the possible content combinations.

The following content / rate type combinations are valid

Rate Type Text Image File Video Video & Text Video & Text & Button Text & Button Text & Button & Image
Transaction
Promotion
Session

The rate types have as well consequences on the charging applied by viber per message.

Base URLs

Messaging

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

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/messages \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/messages HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/json
apikey: API_KEY

const inputBody = '{
  "to": "+123234234",
  "from": "545345345",
  "channel": "viber",
  "messagePurpose": "promotion",
  "content": {
    "contentType": "text",
    "text": "A simple text message"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/messages',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/messages',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/messages', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/messages', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/messages");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/messages", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /messages

Send messages via this path.

Body parameter

{
  "to": "+123234234",
  "from": "545345345",
  "channel": "viber",
  "messagePurpose": "promotion",
  "content": {
    "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",
  "timestamp": "2019-08-24T14:15:22Z"
}

400 Response

{
  "status": 400,
  "violations": [
    {
      "field": "validate.request.content.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 response after the server has accepted the request 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 The default response in case of any other error. Please check the error object for details Problem

Send a bulk message

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/bulks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/bulks HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/json
apikey: API_KEY

const inputBody = '{
  "to": "+1233423454",
  "from": "+1233423454",
  "messagePurpose": "promotion",
  "rateType": "promotion",
  "channel": "viber",
  "messages": [
    {
      "contentType": "text",
      "text": "string"
    },
    {
      "contentType": "text",
      "text": "string"
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/bulks',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.post 'https://api.tyntec.com/conversations/v3/bulks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://api.tyntec.com/conversations/v3/bulks', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.tyntec.com/conversations/v3/bulks', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/bulks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.tyntec.com/conversations/v3/bulks", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /bulks

Send bulk messages. Bulk messages are defined as ordered messages to one receiver.

Body parameter

{
  "to": "+1233423454",
  "from": "+1233423454",
  "messagePurpose": "promotion",
  "rateType": "promotion",
  "channel": "viber",
  "messages": [
    {
      "contentType": "text",
      "text": "string"
    },
    {
      "contentType": "text",
      "text": "string"
    }
  ]
}

Parameters

Name In Type Required Description
body body BulkMessageRequest true The message bulk you would like to send

Example responses

202 Response

{
  "bulkId": "string",
  "messageIds": [
    "string"
  ]
}

400 Response

{
  "status": 400,
  "violations": [
    {
      "field": "validate.request.content.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 response after the server has accepted the request BulkMessageResponse
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 The default response in case of any other error. Please check the error object for details Problem

Service IDs

List all Service IDs configured for your API account.

List Service IDs

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/configurations/channels/viber \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/configurations/channels/viber HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/configurations/channels/viber',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/configurations/channels/viber',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/configurations/channels/viber', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/configurations/channels/viber', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/configurations/channels/viber");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/configurations/channels/viber", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /configurations/channels/viber

List all Service ID configurations available to your API account

Example responses

200 Response

[
  {
    "channel": "viber",
    "scopes": [
      "messages:read",
      "callbacks:write",
      "callbacks:read"
    ],
    "id": {
      "serviceId": "1234"
    },
    "name": "Your Company",
    "callback": {
      "callbackVersion": "2.11",
      "inboundMessageUrl": "https://your.server.com/inbound",
      "messageStatusUrl": "https://your.server.com/status",
      "eventFilter": [
        "MessageStatus::accepted",
        "MessageStatus::delivered"
      ]
    }
  }
]

403 Response

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

Responses

Status Meaning Description Schema
200 OK A list of Viber channel configurations ViberChannelResponses
403 Forbidden You attempting to use a number that is not assigned to your account Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Read a configuration

Code samples

# You can also use wget
curl -X GET https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id} \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

GET https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id} HTTP/1.1
Host: api.tyntec.com
Accept: application/json
apikey: API_KEY


const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.get 'https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /configurations/channels/viber/service-ids/{service-id}

Returns the specific channel configuration

Parameters

Name In Type Required Description
service-id path integer true The Service ID used for a Viber Channel.

Example responses

200 Response

{
  "channel": "viber",
  "scopes": [
    "messages:read",
    "callbacks:write",
    "callbacks:read"
  ],
  "id": {
    "serviceId": "1234"
  },
  "name": "Your Company",
  "callback": {
    "callbackVersion": "2.11",
    "inboundMessageUrl": "https://your.server.com/inbound",
    "messageStatusUrl": "https://your.server.com/status",
    "eventFilter": [
      "MessageStatus::accepted",
      "MessageStatus::delivered"
    ]
  }
}

403 Response

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

Responses

Status Meaning Description Schema
200 OK A Viber channel configuration ViberChannelResponse
403 Forbidden You attempting to use a number that is not assigned to your account Problem
default Default The default response in case of any other error. Please check the error object for details Problem

Callback configuration

In this section, we guide you on how to configure the callbacks on a per-channel basis.

Update the callback

Code samples

# You can also use wget
curl -X PUT https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

PUT https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks HTTP/1.1
Host: api.tyntec.com
Content-Type: application/json
Accept: application/json
apikey: API_KEY

const inputBody = '{
  "callbackVersion": "2.11",
  "inboundMessageUrl": "string",
  "messageStatusUrl": "string",
  "eventFilter": []
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

result = RestClient.put 'https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.put('https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks', params={

}, headers = headers)

print(r.json())

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
con.setRequestProperty("apikey", "API_KEY");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PUT", "https://api.tyntec.com/conversations/v3/configurations/channels/viber/service-ids/{service-id}/callbacks", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PUT /configurations/channels/viber/service-ids/{service-id}/callbacks

Update the callback settings of a specific Service ID.

Body parameter

{
  "callbackVersion": "2.11",
  "inboundMessageUrl": "string",
  "messageStatusUrl": "string",
  "eventFilter": []
}

Parameters

Name In Type Required Description
body body ChannelCallback false none
service-id path integer true The Service ID used for a Viber Channel.

Example responses

200 Response

{
  "channel": "viber",
  "scopes": [
    "messages:read",
    "callbacks:write",
    "callbacks:read"
  ],
  "id": {
    "serviceId": "1234"
  },
  "name": "Your Company",
  "callback": {
    "callbackVersion": "2.11",
    "inboundMessageUrl": "https://your.server.com/inbound",
    "messageStatusUrl": "https://your.server.com/status",
    "eventFilter": [
      "MessageStatus::accepted",
      "MessageStatus::delivered"
    ]
  }
}

400 Response

{
  "status": 400,
  "violations": [
    {
      "field": "validate.request.content.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
200 OK A Viber channel configuration ViberChannelResponse
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 The default response in case of any other error. Please check the error object for details Problem

Schemas

Problem

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

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

Properties

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

MessageResponse

{
  "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
  "timestamp": "2019-08-24T14:15:22Z"
}

Properties

Name Type Required Restrictions Description
messageId string(uuid) true none A global unique Message Id reference
timestamp string(date-time) true none A point in time when the API confirms that the message request was accepted

BulkMessageResponse

{
  "bulkId": "string",
  "messageIds": [
    "string"
  ]
}

Properties

Name Type Required Restrictions Description
bulkId string false none none
messageIds [string] false none none

MessageRequest

{
  "to": "+123234234",
  "from": "545345345",
  "channel": "viber",
  "messagePurpose": "promotion",
  "content": {
    "contentType": "text",
    "text": "A simple text message"
  }
}

The message you would like to send. Either rate type or message purpose must be set

Properties

Name Type Required Restrictions Description
to string true none The message's recipient
The format depends on the specific channel
from string true none The Viber service id the message origins from
messagePurpose string false none The alias for the message's rate type
rateType string false none The rate type of the message. Note Since Viber has lifted the service types, this
affects the rate for each message. Also, the potential content that can be sent (see table above)
channel string true none The channel selected for delivery.
overrides object false none Overrides of defaults for this message
» notificationCallbackUrl string false none When present this url is used for sending the delivery notifications to your webhook.
Can be used for debugging use cases or individual routings.
context string false none The context for this particular message
content any false none none

oneOf

Name Type Required Restrictions Description
» anonymous ViberTextContent false none none

xor

Name Type Required Restrictions Description
» anonymous ViberImageContent false none none

xor

Name Type Required Restrictions Description
» anonymous ViberFileContent false none A file content wrapper for Viber

xor

Name Type Required Restrictions Description
» anonymous ViberComponentsContent false none none
Enumerated values
Property Value
messagePurpose promotion
messagePurpose transaction
messagePurpose session
rateType promotion
rateType transaction
rateType session
channel viber

BulkMessageRequest

{
  "to": "+1233423454",
  "from": "+1233423454",
  "messagePurpose": "promotion",
  "rateType": "promotion",
  "channel": "viber",
  "messages": [
    {
      "contentType": "text",
      "text": "string"
    },
    {
      "contentType": "text",
      "text": "string"
    }
  ]
}

The bulk of messages you would like to send. Either rate type or message purpose must be set

Properties

Name Type Required Restrictions Description
to string true none The message's recipient
The format depends on the specific channel
from string true none The sender of the messages. The format depends on the specific channel.
messagePurpose string false none The alias for the message's rate type
rateType string false none The rate type of the message. Note Since Viber has lifted the service types, this
affects the rate for each message. Also the potential content that can be sent (see table above)
channel string true none The channel selected for delivery.
messages [oneOf] true none none

oneOf

Name Type Required Restrictions Description
» anonymous ViberTextContent false none none

xor

Name Type Required Restrictions Description
» anonymous ViberImageContent false none none

xor

Name Type Required Restrictions Description
» anonymous ViberFileContent false none A file content wrapper for Viber

xor

Name Type Required Restrictions Description
» anonymous ViberVideoContent false none none

xor

Name Type Required Restrictions Description
» anonymous ViberComponentsContent false none none
Enumerated values
Property Value
messagePurpose promotion
messagePurpose transaction
messagePurpose session
rateType promotion
rateType transaction
rateType session
channel viber

ViberTextContent

{
  "contentType": "text",
  "text": "string"
}

Properties

Name Type Required Restrictions Description
contentType string false none none
text string false none none
Enumerated values
Property Value
contentType text

ViberTextBody

{
  "type": "text",
  "text": "string"
}

Properties

Name Type Required Restrictions Description
type string false none none
text string false none none
Enumerated values
Property Value
type text

ViberImageContent

{
  "contentType": "image",
  "image": {
    "url": "string"
  }
}

Properties

Name Type Required Restrictions Description
contentType string false none none
image ViberImage false none none
Enumerated values
Property Value
contentType image

ViberVideoContent

{
  "contentType": "video",
  "video": {
    "url": "string",
    "thumbnailUrl": "string",
    "type": "3gp",
    "filesize": 0,
    "duration": 0
  }
}

Properties

Name Type Required Restrictions Description
contentType string false none none
video ViberVideo false none Viber video specification
Enumerated values
Property Value
contentType video

ViberVideoBody

{
  "type": "video",
  "video": {
    "url": "string",
    "thumbnailUrl": "string",
    "type": "3gp",
    "filesize": 0,
    "duration": 0
  }
}

Properties

Name Type Required Restrictions Description
type string false none none
video ViberVideo false none Viber video specification
Enumerated values
Property Value
type video

ViberImageBody

{
  "type": "image",
  "image": {
    "url": "string"
  }
}

Properties

Name Type Required Restrictions Description
type string false none none
image ViberImage false none none
Enumerated values
Property Value
type image

ViberFileContent

{
  "contentType": "file",
  "file": {
    "url": "string",
    "filename": "string",
    "type":