Channels & integrations

Connect WebEngage to send approved WhatsApp Business templates through Querygen.

WebEngage Private WSP

Querygen can act as a Private WhatsApp Service Provider endpoint for WebEngage campaigns. This optional organization-level integration sends approved Meta templates through a connected WhatsApp Business number.

Before You Start

  • Connect the Meta WhatsApp Business number WebEngage will use as its sender.
  • Make sure the required message templates are approved in Meta.
  • Create an organization API key in Settings > API Keys.
  • Optional: get the DSN URL and bearer token from WebEngage if you want status callbacks.

Configure Querygen

  1. Open Settings > WhatsApp Business and expand WebEngage Private WSP.
  2. Optional: add both the WebEngage DSN URL and bearer token for status callbacks. The token is not displayed again after saving.
  3. Turn on Enable WebEngage Private WSP and select Save settings.
  4. Copy the Private WSP endpoint shown in the panel.

Configure WebEngage

  1. Use the copied Querygen URL as the Private WSP endpoint.
  2. Add Authorization: Basic qg_… as a custom header. If the key is not organization-scoped, also send X-Organization-Id.
  3. Choose either Send Personalization Variables or Send Entire Message.
  4. Send the customer’s plain phone number as toNumber, including the country code.
Important: Querygen accepts plain E.164 phone numbers only. Leave WebEngage’s optional we_hashed_phone mode off. Hashed PII, location, carousel, and copy-code parameters are not supported.

Request Modes

  • Personalization Variables: WebEngage sends the template name, language, and parameter values. Querygen applies those values to the matching approved Meta template.
  • Entire Message: WebEngage sends rendered body and optional text-header content. Querygen matches it against the approved Meta template and extracts numbered parameter values. A mismatch is reported as a failed status.
  • TEXT, IMAGE, VIDEO, and DOCUMENT templates are supported. Media templates require a publicly reachable mediaUrl.
Example request from WebEngage
curl -X POST "https://messages.querygen.ai/v1/public/webengage/private-wsp" \
  -H "Authorization: Basic qg_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "version": "1.0",
    "whatsAppData": {
      "toNumber": "+919876543210",
      "fromNumber": "919820160046",
      "templateData": {
        "templateName": "order_update",
        "templateVariables": ["42", "shipped"],
        "language": "en",
        "type": "TEXT"
      }
    },
    "metadata": {
      "campaignType": "TRANSACTIONAL",
      "timestamp": "2026-09-07T12:00:00+0530",
      "messageId": "webengage-message-id"
    }
  }'

Status Reporting

The endpoint acknowledges a request after SQS stores it. Validation and sending happen afterward. Configure the WebEngage DSN URL to receive whatsapp_sent, whatsapp_read, and whatsapp_failed statuses. Reusing the same WebEngage message ID does not send the message twice. The settings panel shows recent authenticated requests and links accepted requests to the API Messages campaign.

Requests rejected during validation, such as an invalid API key or unsupported payload, do not become API Messages and do not generate a delivery callback. Contact support if WebEngage shows an accepted request that does not appear in the settings panel.

Note: Pause WebEngage campaigns before turning the integration off. The queue still acknowledges incoming requests, but the app will reject them during processing and alert on the failed records. DSN delivery also pauses. Other WhatsApp Business traffic continues normally.