Thumbnail
WhatsApp Tech Docs | Capabilities and Features

With the WhatsApp Business API, enterprises have access to an array of capabilities and multimedia features.

WhatsApp Use Cases | tyntec

Features of WhatsApp Business Account

  • Your Brand: with a Business Account, your company name is clearly visible at the top.
  • Your Logo: upload a logo for easy recognition (640x640 px, <5 MB)
  • Get Verified: With a verified badge in green (optional), you add more trust to your customer communications.
  • Encryption: WhatsApp messages are encrypted from tyntec to the device, and secured over HTTPS (and optional SSL/VPN) from your application to tyntec.
  • Message Templates: you can initiate conversations with pre-approved message templates (text only for now).
  • Send Rich Media: you can send multimedia messages in the “support window”. These include images, documents, videos, locations, and more.

Allow Customers to Reach You and Process Conversational Signals:

  • Delivery and Read Receipts: you see in real-time when the message has been delivered and read directly on the WhatsApp interface.
  • Track Replies: you can always refer to specific messages when replying.
  • Track Deleted Messages: Manage your messages and delete them when necessary.
  • Receive Media: your consumers can send an array of multimedia functions to your Business Account.

Group Messaging

The Group Messaging feature enables you to further personalize WhatsApp interactions with your customers. With this new feature, your agents or advisors can connect directly with your customers with dedicated group profiles, powering conversations with VIP clients or consulting services, for example.

When creating a group, the logo and the subject are setup when creating the group, but can be changed later. The image can be the company logo, the photo of an advisor; pretty much any image that is relevant for that group. The subject must have a maximum of 35 characters.

The tyntec API currently supports the following functionalities:

  • listing all groups
  • creating a new group
  • getting list of participants and remove them from the group
  • getting information about the group
  • updating the group profile and icon
  • maintaining the invite link
  • group chat itself via the normal messaging api
  • group specific events, like user has joined group or user has left group

 

To Create a New Group:

Request
curl -X POST \
  https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/4923147790717/groups \
  -H 'Content-Type: application/json' \
  -H "apikey: $API_KEY" \
  -d '{
               "subject" : "Group Subject"
}'
 
Response
{
    "creationTime": "1564642001",
    "groupId": "4923147790717-1564642001"
}

To Update the Group Icon:

Request
curl -X PUT \
  https://api.tyntec.com/chat-api/v2/channels/whatsapp/phone-numbers/4923147790717/groups/4923147790717-1564642001/settings/icon \
  -H 'Content-Type: image/jpeg' \
  -H "apikey: $API_KEY" 
 
 
Response
201 Created

To Send a Link via a Message Template:

Request
curl -X POST \
  https://api.tyntec.com/chat-api/v2/messages \
  -H 'Content-Type: application/json' \
  -H "apikey: $API_KEY" 
  -d '{
"to": "27345879345345", 
 "channels": ["whatsapp"],
"whatsapp": {
              "from" : "4923147790717",
              "template" : {
                             "templateId": "group_invite",
                             "language": {
                                           "policy": "deterministic",
                                           "code": "en"
                             },
                             "parameters" : [
                                           {"default": "https://chat.whatsapp.com/CwTQduEL81WHnO9R3QKV20"}
                                           ]
 
 
               },
              "contentType":"template"
}
}'
 
Response
{
    "messageId": "7e8083f5-6ead-4aea-a4b9-ec5feb948c88"
}

To Send a Text Message to the Group:

Request
curl -X POST \
  https://api.tyntec.com/chat-api/v2/messages \
  -H 'Content-Type: application/json' \
  -H "apikey: $API_KEY"  \
  -d '{
"to": "4923147790717-1564642001", 
 "channels": ["whatsapp"],
"whatsapp": {
              "from" : "4923147790717",
              "text" : "Hi! And welcome to our group",
              "contentType":"text"
}
}'
 
Response
{
    "messageId": "8953ccfa-3a3a-4eca-a225-324bb8979332"
}

Multimedia Messages

At the moment, there are four main message features supported by tyntec’s WhatsApp Business API. These are Template Messages — ideal for alerts and notifications, Simple Text, Images, and Audio Files. Below you'll find examples of each and their respective codes.

Template Message

Template Message Code:

curl –XPOST https://api.tyntec.com/messaging/v2/chat/messages\
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
-d '{
  "to": "+123234234",
  "channels": [
    "whatsapp"
  ],
  "whatsapp": {
    "from": 545345345,
    "contentType": "template",
    "template": {
    "templateId" : "order_confirmation",
   "language" : {
      "policy"  : "deterministic",
      "code" : "en"
    },
    "parameters" : {
      "default" : "Ben",
      "default" : "2019-0000001",
      "default" : "600.00",
      "default" : "2019-06-01"
    }
  }
  }
}'

Simple Text Message

Simple Text Code:
curl –XPOST https://api.tyntec.com/messaging/v2/chat/messages\
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
-d '{
  "to": "+123234234",
  "channels": [
    "whatsapp"
  ],
  "whatsapp": {
    "from": 545345345,
    "contentType": "text",
    "text":  "Hi Ben! Thanks for contacting our customer support"
  }
}'

Images

Image Code:
curl –XPOST https://api.tyntec.com/messaging/v2/chat/messages\
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
-d '{
  "to": "+123234234",
  "channels": [
    "whatsapp"
  ],
  "whatsapp": {
    "from": 545345345,
 
      "contentType": "media", 
      "type": "image" 
      "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec-logo-color.svg",
  "caption": "Tyntec Logo"
  }
}'

Audio Files

Audio File Code:

curl –XPOST https://api.tyntec.com/messaging/v2/chat/messages\
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
-d '{
  "to": "+123234234",
  "channels": [
    "whatsapp"
  ],
  "whatsapp": {
    "from": 545345345,
      "contentType": “media", 
      "type": “audio" 
      "url": "https://www.tyntec.com/themes/custom/tyntec/image/tyntec_song.mp3"
    }
}'

Location

Location Code:

# Send a location
Request
curl -X POST \
  https://api.tyntec.com/chat-api/v2/messages \
  -H 'Content-Type: application/json' \
  -H 'apikey: c6aa0006798047f38d16ed7d2673c595' \
   -H "apikey: $API_KEY"  \
  -d '{
"to": "4917624435312", 
 "channels": ["whatsapp"],
"whatsapp": {
              "from" : "4923147790717",
              "location" : {
                             "longitude" : 7.4954884,
                             "latitude" : 51.5005765,
                             "name" : "tyntec GmbH",
                             "address" : "tyntec GmbH, Semerteichstraße, Dortmund"
              },
              "contentType":"location"
}
}'

Querying the Message Status

The current status of a message can be checked via our API as well. This might be interesting for you if you haven’t setup a notification webhook or need to manually query the status. The following example explains how message status can be checked:
curl https://api.tyntec.com/messaging/v2/chat/messages/77185196-664a-43ec-b14a-fe97036c697f/status \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

Below, will be the returning code if your message did not go through:

{
  "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
 "status": "failed"
}

If your message failed to go through, you can check the history in the next section — Querying the Message History

Querying the Message History

In case you need further details on a message, such as if you received a send failure — you can easily check this with the following:
curl https://api.tyntec.com/messaging/v2/chat/messages/77185196-664a-43ec-b14a-fe97036c697f/history \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY'

This will trigger a response such as:

{
  "messageId": "77185196-664a-43ec-b14a-fe97036c697f",
      "history": [
        {
            "happendAt": "2019-05-17T09:45:00Z",
            "state": "message-accepted"
        },
        {
            "deliveryChannel": "whatsapp",
            "happendAt": "2019-05-17T09:45:01Z ",
            "state": "message-routing-success"
        },
        {
            "deliveryChannel": "whatsapp",
            "happendAt": "2019-05-17T09:45:02Z ",
            "state": "message-dispatching-success"
        },
        {
            "deliveryChannel": "whatsapp",
            "happendAt": "2019-05-17T09:45:03Z ",
            "state": "message-failed",
            "details": {
                "code": "470",
                "message": "Message failed to send because more than 24 hours have passed since the customer last replied to this number"
            }
        },
        {
            "happendAt": "2019-05-17T09:45:04Z ",
            "state": "message-finally-failed",
            "details": {
                "code": "tyntec::error:noFurtherChannelAvailable",
                "message": "No further channel after Channel[whatsapp] available"
            }
        }
    ]
}

In this example, the message because the brand tried to send a text message outside of the 24h support window, and no fallback was specified.