Triggering an outbound WhatsApp virtual agent

You can jumpstart the outbound session from any platform of your choosing, e.g. Postman.

You can add dynamic parameters to your template that will change according to the value you add to your query. See the example below for "PARAM1_VALUE".

The query will look like the following -

Endpoint (mandatory)

The endpoint depends on the region you selected for your agent

For EU agents --> https://studio-api-eu.ai.vonage.com/messaging/conversation

For US agents --> https://studio-api-us.ai.vonage.com/messaging/conversation

Method (mandatory)

POST

Headers (mandatory)

X-Vgai-Key

You can find the X-Vgai-Key on the top right of your canvas. Click on the "user" icon, and then "Generate API Key".

Request Body

{
    "components": [
        {
            "type": "header",
            "parameters": [
                {
                    "type": "text",
                    "text": "PARAM1_VALUE"
                }
            ]
        },
        {
            "type": "body",
            "parameters": [
                {
                    "type": "text",
                    "text": "PARAM2_VALUE"
                }
            ]
        }
    ],
    "namespace": "NAMESPACE_ID",
    "template": "TEMPLATE_NAME",
    "locale": "en",
    "to": "TO_NUMBER",
    "agent_id": "AGENT_ID",
    "channel": "whatsapp",
    "status_url": "string",
    "session_parameters": [
    {
      "name": "string",
      "value": "string"
    }
  ]
}

Details surrounding Namespace and Template can be found on your WhatApp Business Account under the template you want to use.

For testing purposes, we recommend using the Webhook site for a dummy Status URL so that you can make sure you are receiving the status of your messages (sent, delivered, read, etc) accurately.

Once you have tested out this functionality, you can replace the Status URL with the actual URL you want to receive the message statuses on.

Last updated

Was this helpful?