4. Sending a subscriber to a mailing Campaign via API

The method is intended for trigger-based sending of an existing Subscriber into an existing Mailing Campaign. Data is transmitted in application/json format.

HTTP Request
  • URL: https://sender-solutions.com/api/subscribers/send-subscriber-into-campaign/
  • HTTP Method: POST
  • Content-Type: application/json
Request Body (JSON)
{
    "SendIntoCampaign": {
        "SubscriberId": 21,
        "CampaignId": 5,
        "Variables": {
            "myVar1": "myVar1 value",
            "myVar2": {
                "option1": "myVar2 option value"
            }
        }
    }
}
Example request using cURL

curl --location 'https://sender-solutions.com/api/subscribers/send-subscriber-into-campaign/' \
--header 'Content-Type: application/json' \
--header 'Authorization: {{api-token}}' \
--data '{
    "SendIntoCampaign": {
        "SubscriberId": 21,
        "CampaignId": 5,
        "Variables": {
            "myVar1": "myVar1 value",
            "myVar2": {
                "option1": "myVar2 option value"
            }
        }
    }
}'
Field Description
Field Type Required Description
SendIntoCampaign.SubscriberId number Subscriber identifier
SendIntoCampaign.CampaignId number Mailing campaign identifier
SendIntoCampaign.Variables array Additional variables to pass to the email template. This is an object with a flexible structure, where the first-level keys (property names) are variables that will be available in the template. Variable names must not conflict with those available at the system level in the template, such as subscriber
Example of a Successful Response
{
    "success": true,
    "SendIntoCampaign": {
        "SendMessageRequestId": 41,
        "SubscriberId": 21,
        "CampaignId": 5,
        "MessageId": "kidabt3j31mo6vp611gx2yfpo4zr1a5c@sender-solutions.com"
    }
}

In the response body, the SendIntoCampaign.SendMessageRequestId field is responsible for the unique identifier of the task for sending a single email. The SendIntoCampaign.MessageId field, in turn, represents the unique value used for the Message-ID header in the email.
This data may be useful for making other requests to our API or when contacting technical support.