Delivery Endpoint

The Delivery Endpoint tab is used to trigger a campaign delivery via a specified endpoint.

Once the campaign has been set up with API Endpoint as recipients and is in Live status, the Delivery Endpoint tab will be available from the Reports section.

The Delivery Endpoint tab is available for the following interactive campaigns:

  • Raffle Giveaway
  • Trivia
  • Web Polls & Surveys
  • Chatbot

Below are the key components and steps to use this tab effectively:

Endpoint URL

This is an example endpoint where the POST request should be sent to trigger the campaign.

https://elastic.messangi.me/thetrident/v1/campaigns/<Campaign_ID>/trigger

JSON Payload

This section provides an example of the JSON payload required to trigger the campaign.

{
  "receiver": "5555555",
  "campaignLabel": "demo"
}

Request Response

This section shows a sample response you can expect after triggering the campaign.

{
  "meta": {
    "timestamp": 1720468236,
    "transactionId": "09bda99e-bf9e-4e69-a190-341b3b",
    "explain": "Request accepted"
  }
}

Sample

Once explained each section, we proceeded to test the delivery endpoint. There are two ways to test this endpoint via UI or cURL.

  • Test Endpoint (UI)

    In the Delivery Endpoint tab, you will find a button named Test Campaign. When this button is selected, a pop-up window appears, allowing you to test the delivery endpoint.

    The pop-up window titled Send Campaign Test requires the following inputs to test the campaign delivery:

    1. Campaign Label (required): Enter an identifier label of the campaign you wish to test.
    2. Receiver (required):
      • Country/Region: Select the recipient’s country or region from the dropdown menu.
      • Phone Number: Enter the recipient’s phone number.
    3. Action buttons:
      • Send Request: By selecting the Send Request button, the campaign is sent to the recipient (receiver) and the platform will provide you the next response "Request accepted"
      • Cancel: Click this button to close the pop-up window without sending a test request.

    By providing the necessary details and clicking Send Request, you can simulate the delivery of a campaign to verify that the endpoint is functioning correctly.


  • Test Endpoint (cURL)
    This section provides a cURL command that can be used to trigger the campaign from the command line. This command includes the necessary headers and JSON payload.

    curl --location --request POST 'https://elastic.messangi.me/thetrident/v1/campaigns/<Campaign_ID>/trigger' --header 'Content-Type: application/json'  --header 'Authorization: Bearer <YOUR_API_KEY>'  --data-raw '{
    	"receiver": "+525500000000",
    	"campaignLabel": "demo"
    }'
    

    Parameters

    • Campaign Id (required): Unique identifier of the campaign you are testing the delivery endpoint.
    • receiver (required): Destination address of the message. Enter the mobile phone number of the recipient you want to send your campaign to. The mobile phone number must be specified in E.164 format → (‘+’ and a country code).
    • campaignLabel (required): Enter an identifier label of the campaign you wish to test.

    Once the request is sent, the campaign is sent to the recipient (receiver) and it will provide you the next response "Request accepted".