Campaigns

This section shows the available routes related to AcyMailing campaigns

Get campaigns

GET https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaigns

Get a collection of campaigns

Query Parameters

Headers

Get one Campaign

GET https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=getCampaignById&campaignId={id}

Get a campaign by id

Query Parameters

Headers

Create or update a campaign

POST https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=createOrUpdateCampaign

Headers

Example of JSON body:

  1. If you want to create a simple campaign which will be sent when you call the send endpoint:

{
    "subject": "This is a test from the api",// Required
    "name": "Name of the campaign from the api", // Required
    "body": "This is the body of the email", // Not required
    "bcc": "address@example.com", // Not required
    "sending_type": "now", // Default "now"
    "listIds": [1, 34, 11] // Not required
}
  1. If you want to create a campaign and schedule it for later:

{
    "subject": "This is a test from the api",// Required
    "name": "Name of the campaign from the api", // Required
    "body": "This is the body of the email", // Not required
    "bcc": "address@example.com", // Not required
    "sending_type": "scheduled", // Default "now"
    "sending_date": "2024-06-14",
    "listIds": [11] // Not required
}
  1. If you want to create an automatic campaign which will be trigger every cron:

{
    "subject": "This is a test from the api",// Required
    "name": "Name of the campaign from the api", // Required
    "body": "This is the body of the email", // Not required
    "bcc": "address@example.com", // Not required
    "sending_type": "auto", // Default is "now"
    "frequency": "cron", // Required if sending_type is auto, must be "every" or "cron"
    "need_confirm": 0, // Default is 1
    "start_date": "2024-05-22", // Not required
    "listIds": [1, 34, 11] // Not required
}
  1. If you want to create an automatic campaign that will trigger every X hour, day, week or month:

{
    "subject": "This is a test from the api",// Required
    "name": "Name of the campaign from the api", // Required
    "body": "This is the body of the email", // Not required
    "bcc": "address@example.com", // Not required
    "sending_type": "auto", // Default is "now"
    "frequency": "every", // Required if sending_type is set to "auto", must be "every" or "cron"
    "frequency_options": { // Required if frequency is set to "every"
        "unit": "month", // Must be "hour", "day", "week" or "month"
        "value": 12
    },
    "need_confirm": 0, // Default is 1
    "start_date": "2024-05-22", // Not required
    "listIds": [1, 34, 11] // Not required
}

5. If you want to update a campaign you need to add the campaignId in the body:

{
    "campaignId": 12,
    "subject": "This is a test from the api",// Required
    "name": "Name of the campaign from the api", // Required
    "body": "This is the body of the email", // Not required
    "bcc": "address@example.com", // Not required
    "sending_type": "now", // Default "now"
    "listIds": [1, 34, 11] // Not required
}

You can only create automatic campaign with 2 type of triggers with the API: On every cron or every X hour, day, week or month.

Send a campaign

POST https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=sendCampaign

Send a campaign by ID

Query Parameters

Headers

Delete a campaign

DELETE https://www.example.com/index.php?page=acymailing_front&option=com_acym&ctrl=api&task=deleteCampaign&campaignId={id}

Delete a campaign by ID

Query Parameters

Headers

Last updated