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)

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.
  • 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
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
  • 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 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 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.19

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."
      ]
    },
    "messageSendTimeToLiveSeconds": 120
  }
]

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
» messageSendTimeToLiveSeconds integer false none If WhatsApp is unable to deliver a message to a user, we will continue attempting to deliver the message for a period of time known as a time-to-live. Newly created authentication templates have a default time-to-live of 10 minutes. Possible values for an authentication template is value between 60 and 600 seconds. Additionally, -1 is set time-to-live for message default value (24 hours Cloud API or 30 days for On-Premises API).
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 ka
language kk
language kn
language ko
language ky_KG
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 rw_RW
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"
    }
  ],
  "messageSendTimeToLiveSeconds": 60
}';
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"
    }
  ],
  "messageSendTimeToLiveSeconds": 60
}

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

Edit template

Code samples

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

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

const inputBody = '{
  "category": "MARKETING",
  "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}/{template-language}',
{
  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/accounts/{whatsapp-account-id}/templates/{template-id}/{template-language}',
  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/accounts/{whatsapp-account-id}/templates/{template-id}/{template-language}', 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/accounts/{whatsapp-account-id}/templates/{template-id}/{template-language}', 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}/{template-language}");
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/accounts/{whatsapp-account-id}/templates/{template-id}/{template-language}", data)
    req.Header = headers

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

PATCH /channels/whatsapp/accounts/{whatsapp-account-id}/templates/{template-id}/{template-language}

Edit a template in a specific language.

Body parameter

{
  "category": "MARKETING",
  "components": [
    {
      "type": "BODY",
      "text": "string"
    }
  ]
}

Parameters

Name In Type Required Description
body body TemplatePatchRequest true The template patch request. Exactly one out of category and components must be present.
whatsapp-account-id path string true WhatsApp account ID
template-id path string true Referenced template
template-language path string true Template localizations language code
Detailed description

body: The template patch request. Exactly one out of category and components must be present.

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
200 OK OK. 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

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

Get commerce icons setting

Code samples

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

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce 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/commerce',
{
  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/commerce',
  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/commerce', 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/commerce', 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/commerce");
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/commerce", data)
    req.Header = headers

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

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

Parameters

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

Example responses

200 Response

{
  "enabled": true
}

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 commerce setting WhatsAppCommerceSettings
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

Set commerce icons setting

Code samples

# You can also use wget
curl -X POST https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce?enable=true \
  -H 'Accept: application/problem+json' \
  -H 'apikey: API_KEY'

POST https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce?enable=true 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/phone-numbers/{phone-number}/settings/commerce?enable=true',
{
  method: 'POST',

  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.post 'https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce',
  params: {
  'enable' => 'boolean'
}, headers: headers

p JSON.parse(result)

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

r = requests.post('https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce', params={
  'enable': 'true'
}, 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('POST','https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce', 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/commerce?enable=true");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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("POST", "https://api.tyntec.com/conversations/v3/channels/whatsapp/phone-numbers/{phone-number}/settings/commerce", data)
    req.Header = headers

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

POST /channels/whatsapp/phone-numbers/{phone-number}/settings/commerce

Parameters

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

Example responses

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 commerce setting successfully set None
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

Flows management

Flows management enables you to interact with the flows defined for your WhatsApp account. The Flows API enables you to perform a variety of operations with Flows, like create flows, update flows, get flows, publish...

List flows

Code samples

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

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows 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}/flows',
{
  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}/flows',
  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}/flows', 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}/flows', 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}/flows");
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}/flows", data)
    req.Header = headers

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

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

Lists all flows of your WhatsApp account, including flows in draft and deprecated state

Parameters

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

Example responses

200 Response

[
  {
    "id": 12345678901234,
    "name": "Flow test",
    "status": "DRAFT",
    "categories": [
      "OTHER"
    ],
    "validationErrors": []
  }
]

404 Response

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

Responses

Status Meaning Description Schema
200 OK Returned the flows WhatsAppFlows
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

Create basic flow data

Code samples

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

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

const inputBody = '{
  "name": "Test flow",
  "categories": [
    "OTHER"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows',
{
  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/channels/whatsapp/accounts/{whatsapp-account-id}/flows',
  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/channels/whatsapp/accounts/{whatsapp-account-id}/flows', 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/channels/whatsapp/accounts/{whatsapp-account-id}/flows', 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}/flows");
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/channels/whatsapp/accounts/{whatsapp-account-id}/flows", data)
    req.Header = headers

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

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

Body parameter

{
  "name": "Test flow",
  "categories": [
    "OTHER"
  ]
}

Parameters

Name In Type Required Description
body body CreateFlowRequest true The flow basic data you would like to create
whatsapp-account-id path string true WhatsApp account ID

Example responses

201 Response

{
  "flowId": 1234567890123456
}

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": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
201 Created The WhatsApp phone number configuration CreateFlow
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 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

Flow details

Code samples

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

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-id}", data)
    req.Header = headers

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

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

This request will return a single Flow's details.

Parameters

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

Example responses

200 Response

{
  "id": 1234567890123456,
  "name": "Test flow",
  "status": "DRAFT",
  "categories": [
    "SIGN_UP",
    "OTHER"
  ],
  "validationErrors": {
    "error": "INVALID_PROPERTY",
    "errorType": "JSON_SCHEMA_ERROR",
    "message": "The property 'initial-text' cannot be specified",
    "lineStart": 46,
    "lineEnd": 46,
    "columnStart": 17,
    "columnEnd": 30
  },
  "jsonVersion": 3,
  "dataApiVersion": 3,
  "endpointUri": "Test flow",
  "preview": {
    "previewUrl": "https://previewLink.com/flows/1234567890123/preview/?token=bf747eb7",
    "expiresAt": "2024-02-21T15:15:32+0000"
  }
}

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"
}

Responses

Status Meaning Description Schema
200 OK Returned the flow WhatsAppFlowDetail
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

Updating Flow's Metadata

Code samples

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

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

const inputBody = '{
  "name": "Test flow",
  "categories": [
    "OTHER"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}',
{
  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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}',
  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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}', 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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-id}");
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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}", data)
    req.Header = headers

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

POST /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}

Body parameter

{
  "name": "Test flow",
  "categories": [
    "OTHER"
  ]
}

Parameters

Name In Type Required Description
body body UpdateFlowRequest true After you have created your Flow, you can update the name or categories using the update request.
whatsapp-account-id path string true WhatsApp account ID
whatsapp-flow-id path string true WhatsApp flow ID

Example responses

200 Response

{
  "success": true
}

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": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Successfully updated flow info Inline
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 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
» success boolean false none none

Delete flow

Code samples

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

DELETE https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-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/json',
  'apikey' => 'API_KEY'
}

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

p JSON.parse(result)

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

r = requests.delete('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-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('DELETE','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-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}/flows/{whatsapp-flow-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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("DELETE", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}", data)
    req.Header = headers

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

DELETE /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}

Flow can be deleted just when it is in draft state.

Parameters

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

Example responses

200 Response

{
  "success": true
}

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"
}

Responses

Status Meaning Description Schema
200 OK Successfully deleted flow Inline
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 Schema

Status Code 200

Name Type Required Restrictions Description
» success boolean false none none

Get assets of the flow

Code samples

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

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets 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}/flows/{whatsapp-flow-id}/assets',
{
  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}/flows/{whatsapp-flow-id}/assets',
  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}/flows/{whatsapp-flow-id}/assets', 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}/flows/{whatsapp-flow-id}/assets', 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}/flows/{whatsapp-flow-id}/assets");
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}/flows/{whatsapp-flow-id}/assets", data)
    req.Header = headers

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

GET /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets

This request will return list of assets (json) attached to the flow

Parameters

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

Example responses

200 Response

[
  {
    "name": "flow.json",
    "assetType": "FLOW_JSON",
    "downloadUrl": "https://scontent.xx.fbcdn.net/m1/v/test"
  }
]

404 Response

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

Responses

Status Meaning Description Schema
200 OK Returned the asset list WhatsAppFlowAssets
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

To update Flow JSON for a specified Flow, use this request. Add file as application/json. Do not use form-data.

Code samples

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

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

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

};

fetch('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets',
{
  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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets',
  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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets', 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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets', 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}/flows/{whatsapp-flow-id}/assets");
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/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets", data)
    req.Header = headers

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

POST /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/assets

Body parameter

{
  "file": "string"
}

Parameters

Name In Type Required Description
body body object true Add file as application/json. Do not use form-data.
» file body string(binary) false none
whatsapp-account-id path string true WhatsApp account ID
whatsapp-flow-id path string true WhatsApp flow ID

Example responses

200 Response

{
  "success": true,
  "validationErrors": [
    {
      "error": "INVALID_PROPERTY",
      "errorType": "JSON_SCHEMA_ERROR",
      "message": "The property 'initial-text' cannot be specified",
      "lineStart": 46,
      "lineEnd": 46,
      "columnStart": 17,
      "columnEnd": 30
    }
  ]
}

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": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Successfully add json asset Inline
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 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
» success boolean false none none
» validationErrors [FlowValidationError] false none The list of asset validation errors. List is empty if the asset has no errors.
»» error string false none Error name of the flow
»» errorType string false none Type of the error
»» message string false none Error message
»» lineStart string false none The line where error starts, in json flow
»» lineEnd string false none The line where error ends, in json flow
»» columnStart string false none The column where error starts, in json flow
»» columnEnd string false none The column where error ends, in json flow

Code samples

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

GET https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/preview 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}/flows/{whatsapp-flow-id}/preview',
{
  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}/flows/{whatsapp-flow-id}/preview',
  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}/flows/{whatsapp-flow-id}/preview', 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}/flows/{whatsapp-flow-id}/preview', 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}/flows/{whatsapp-flow-id}/preview");
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}/flows/{whatsapp-flow-id}/preview", data)
    req.Header = headers

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

GET /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/preview

In order to visualize the Flows created, you can generate a web preview URL with this request. The preview URL is public and can be shared with different stakeholders to visualize the Flow.

Parameters

Name In Type Required Description
whatsapp-account-id path string true WhatsApp account ID
whatsapp-flow-id path string true WhatsApp flow ID
invalidate query boolean false If invalidate is set to true, a new link will be generated, with new expire date. Otherwise, same one will be used. Default value is false.

Example responses

200 Response

{
  "previewUrl": "https://previewLink.com/flows/1234567890123/preview/?token=bf747eb7",
  "expiresAt": "2024-02-21T15:15:32+0000"
}

404 Response

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

Responses

Status Meaning Description Schema
200 OK Returned the preview link and expire date WhatsAppFlowPreview
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

This request updates the status of the Flow to "PUBLISHED". This action is not reversible. The Flow and its assets become immutable once published.

Code samples

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

POST https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/publish 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}/flows/{whatsapp-flow-id}/publish',
{
  method: 'POST',

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

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

r = requests.post('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/publish', 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('POST','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/publish', 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}/flows/{whatsapp-flow-id}/publish");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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("POST", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/publish", data)
    req.Header = headers

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

POST /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/publish

Parameters

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

Example responses

200 Response

{
  "success": true
}

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": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Successfully published flow Inline
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 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
» success boolean false none none

Once a Flow is published, it cannot be modified or deleted, but can be marked as deprecated.

Code samples

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

POST https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/deprecate 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}/flows/{whatsapp-flow-id}/deprecate',
{
  method: 'POST',

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

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

r = requests.post('https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/deprecate', 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('POST','https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/deprecate', 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}/flows/{whatsapp-flow-id}/deprecate");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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("POST", "https://api.tyntec.com/conversations/v3/channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/deprecate", data)
    req.Header = headers

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

POST /channels/whatsapp/accounts/{whatsapp-account-id}/flows/{whatsapp-flow-id}/deprecate

Parameters

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

Example responses

200 Response

{
  "success": true
}

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": "WhatsApp account unknown"
}

Responses

Status Meaning Description Schema
200 OK Successfully deprecated flow Inline
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 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
» success boolean false none none

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 WhatsAppReactionContent false none A reaction 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

CreateFlowRequest

{
  "name": "Test flow",
  "categories": [
    "OTHER"
  ]
}

The flow data you would like to create

Properties

Name Type Required Restrictions Description
name string true none Flow name
categories [FlowCategory] true none A list of Flow categories. Flow must have at least one category

UpdateFlowRequest

{
  "name": "Test flow",
  "categories": [
    "OTHER"
  ]
}

Flow data you would like to change

Properties

Name Type Required Restrictions Description
name string false none Flow name
categories [FlowCategory] false none A list of Flow categories. Flow must have at least one category

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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

WhatsAppReactionContent

{
  "contentType": "reaction",
  "reaction": {
    "messageId": "wamid.j0nmfofmneofn30fnekn2929",
    "emoji": "😀"
  }
}

A reaction message

Properties

Name Type Required Restrictions Description
contentType string true none Determines the type of the message. Always reaction.
reaction WhatsAppReaction true none An emoji reaction to a formerly sent or received message
Enumerated values
Property Value
contentType reaction

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"
        }
      ],
      "carousel": {
        "cardIndex": 0,
        "components": {
          "header": [
            {
              "type": "image",
              "image": {
                "url": "string",
                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
              }
            }
          ],
          "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

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveLocationMessage false none Interactive Location Message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveFlowMessage false none Interactive Flow Message

xor

Name Type Required Restrictions Description
» anonymous WhatsAppInteractiveAddressMessage false none Interactive Address Message. Only available in India and Singapore
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",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

A base object handling media definitions for sending.

One of both properties url or id must be set

Properties

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

WhatsAppImage

{
  "caption": "string",
  "url": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

An image media specification

Properties

Name Type Required Restrictions Description
caption string false none none

WhatsAppDocument

{
  "caption": "string",
  "filename": "string",
  "url": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

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",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

A video media specification

Properties

Name Type Required Restrictions Description
caption string false none none

WhatsAppAudio

{
  "url": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

An audio media specification

Properties

None

WhatsAppSticker

{
  "url": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

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

WhatsAppReaction

{
  "messageId": "wamid.j0nmfofmneofn30fnekn2929",
  "emoji": "😀"
}

An emoji reaction to a formerly sent or received message

Properties

Name Type Required Restrictions Description
messageId string true none The message id of the message you want to react to.
emoji string true none The actual reaction emoji. Must be a string consisting of exactly one emoji or an empty string to delete a former reaction.

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"
      }
    ],
    "carousel": {
      "cardIndex": 0,
      "components": {
        "header": [
          {
            "type": "image",
            "image": {
              "url": "string",
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            }
          }
        ],
        "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"
    }
  ],
  "carousel": {
    "cardIndex": 0,
    "components": {
      "header": [
        {
          "type": "image",
          "image": {
            "url": "string",
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
          }
        }
      ],
      "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

xor

Name Type Required Restrictions Description
» anonymous WhatsAppFlowButtons false none none

continued

Name Type Required Restrictions Description
carousel WhatsAppCarouselComponent false none List of carousel cards. Carousel must have at least one card, and maximum 10.

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  }
}

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",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

Media header specification

Properties

None

WhatsAppTemplateDocumentHeader

{
  "filename": "Test PDF",
  "url": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
}

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

WhatsAppCarouselComponent

{
  "cardIndex": 0,
  "components": {
    "header": [
      {
        "type": "image",
        "image": {
          "url": "string",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        }
      }
    ],
    "body": [
      {
        "type": "text",
        "text": "string",
        "example": {
          "texts": [
            "John Doe",
            "Order ID 123"
          ]
        }
      }
    ],
    "button": {
      "type": "quick_reply",
      "index": 0,
      "payload": "string"
    }
  }
}

Carousel card definition

Properties

Name Type Required Restrictions Description
cardIndex integer true none order in which card appears within the card carousel. 0 indicates first card, 1 indicates second...
components WhatsAppCarouselTemplateComponents true none none

WhatsAppCarouselTemplateComponents

{
  "header": [
    {
      "type": "image",
      "image": {
        "url": "string",
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      }
    }
  ],
  "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 WhatsAppTemplateImageHeaderComponent false none none

xor

Name Type Required Restrictions Description
» anonymous WhatsAppTemplat