Get all campaigns

Obtain the campaign properties for all EMD Email, Push, Message Center, SMS, or MMS campaigns.

Important: To use the Get All Campaigns API to get all EMD email campaigns, your account must be enabled for Email Message Designer (EMD). Otherwise using the call will result in an error with HTTPS status code of 401 Unauthorized and API_DISABLED_FOR_USER in the error message payload.

Service URL:

/rest/api/v1.3/campaigns

Optional Path Parameters:

Tip: Leave the following parameters set to their default values and use the “prev” and “next” links returned in the response to get additional campaigns as needed.

  • offset: starts at 0 and indicates the record number for the response result set (defaults to 0).
  • limit: number of campaigns to return in the response (defaults to 200 and cannot exceed 200).
  • type: For EMD email campaigns, this can be omitted or use type=email. For clearer client application code, we recommend including type=email, but we allow it to be omitted for backward compatibility.

Request Method:

GET

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Request Body - Required Properties:

Not applicable

RESPONSE NOTES:

  • The response contains an array of up to 200 EMD Email campaign objects per request. This API does not support fetching Classic Email campaigns, so the response will not contain Classic Email campaign objects.
  • Each item in the array contains a campaign object, which includes the campaign ID, the campaign’s other properties, and a links array containing the campaign object’s related API operations (specific to the campaign name where applicable).
  • The campaign properties returned in the response may vary, depending on what was configured for the campaign when it was created.
  • Campaign operations links may or may not be supported by your level of access.
  • The response also contains a links array for the “Get all Email campaigns” interface. This array contains the endpoints for obtaining the previous and next batch of campaign objects.

Sample Request Body

Not applicable

Sample Response Body

The endpoint /rest/api/v1.3/campaigns?type=email&offset=0&limit=5 returned the following response (for brevity, the sample shows only the first and last campaign of the five returned.):

{
  "campaigns": [
    {
      "id": 1000,
      "name": "testcampaign-b11",
      "folderName": "testfolder",
      "type": "EMAIL",
      "campaignStatus": "ACTIVE",
      "description": "description",
      "purpose": "PROMOTIONAL",
      "marketingStrategy": "strategy",
      "marketingProgram": "program",
      "listName": "listname",
      "filterPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "refiningDataSourcePath": "foldername/objectName1",
      "proofListPath": "foldername/objectName1",
      "seedListPath": "foldername/objectName1",
      "segmentPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryCampaignDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryLookupDataSourcePaths"[
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryProofDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementarySeedDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "suppressionListPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "subject": "subject",
      "fromName": "from name",
      "fromEmail": "from email",
      "replyToEmail": "reply to email",
      "bccEmail": "bcc email",
      "htmlMessagePath": "documentPath",
      "textMessagePath": "documentPath",
      "enableExternalTracking": true,
      "externalTrackingParams": {
        "name1": "value1",
        "name2": "value2"
      },
      "enableLinkTracking": true,
      "linkTablePath": "foldername/objectName1",
      "attachmentPaths": [
        "documentPath1",
        "documentPath2"
      ],
      "campaignVariables": {
        "name1": "value1",
        "name2": "value2"
      },
      "useUTF8": true,
      "locale": "value",
      "trackHTMLOpens": true,
      "trackConversions": true,
      "sendTextIfHTMLUnknown": true,
      "segmentTrackingColumnName": "name",
      "unsubscribeOption": "OPTOUT_SINGLE_CLICK",
      "unsubscribeFormName": "name",
      "autoCloseOption": "NO_AUTO_CLOSE",
      "autoCloseValue": "value",
      "closedCampaignURL": "URL",
      "externalCampaignCode": "code",
      "salesForceCampaignId": "salesforce id",
      "links": [
        {
          "rel": "self",
          "href": "/rest/api/v1.3/campaigns/testcampaign-b11",
          "method": "GET"
        },
        {
          "rel": "create",
          "href": "/rest/api/v1.3/campaigns",
          "method": "POST"
        },
        {
          "rel": "updateCampaign",
          "href": "rest/api/v1.3/campaigns/testcampaign-b11",
          "method": "PUT"
        }
      ]
    },
    {
      "id": 1001,
      "name": "testcampaign-b12",
      "folderName": "testfolder",
      "type": "EMAIL",
      "campaignStatus": "ACTIVE",
      "description": "description",
      "purpose": "PROMOTIONAL",
      "marketingStrategy": "strategy",
      "marketingProgram": "program",
      "listName": "listname",
      "filterPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "refiningDataSourcePath": "foldername/objectName1",
      "proofListPath": "foldername/objectName1",
      "seedListPath": "foldername/objectName1",
      "segmentPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryCampaignDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryLookupDataSourcePaths"[
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryProofDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementarySeedDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "suppressionListPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "subject": "subject",
      "fromName": "from name",
      "fromEmail": "from email",
      "replyToEmail": "reply to email",
      "bccEmail": "bcc email",
      "htmlMessagePath": "documentPath",
      "textMessagePath": "documentPath",
      "enableExternalTracking": true,
      "externalTrackingParams": {
        "name1": "value1",
        "name2": "value2"
      },
      "enableLinkTracking": true,
      "linkTablePath": "foldername/objectName1",
      "attachmentPaths": [
        "documentPath1",
        "documentPath2"
      ],
      "campaignVariables": {
        "name1": "value1",
        "name2": "value2"
      },
      "useUTF8": true,
      "locale": "value",
      "trackHTMLOpens": true,
      "trackConversions": true,
      "sendTextIfHTMLUnknown": true,
      "segmentTrackingColumnName": "name",
      "unsubscribeOption": "OPTOUT_SINGLE_CLICK",
      "unsubscribeFormName": "name",
      "autoCloseOption": "NO_AUTO_CLOSE",
      "autoCloseValue": "value",
      "closedCampaignURL": "URL",
      "externalCampaignCode": "code",
      "salesForceCampaignId": "salesforce id",
      "links": [
        {
          "rel": "self",
          "href": "/rest/api/v1.3/campaigns/testcampaign-b12",
          "method": "GET"
        },
        {
          "rel": "create",
          "href": "/rest/api/v1.3/campaigns",
          "method": "POST"
        },
        {
          "rel": "updateCampaign",
          "href": "rest/api/v1.3/campaigns/testcampaign-b12",
          "method": "PUT"
        }
      ]
    }
  ],
  "links": [
    {
      "rel": "self",
      "href": "/rest/api/v1.3/campaigns?type=email",
      "method": "GET"
    },
    {
      "rel": "prev",
      "href": "/rest/api/v1.3/campaigns?limit=200&amp;offset=0&amp;type=email",
      "method": "GET"
    },
    {
      "rel": "next",
      "href": "rest/api/v1.3/campaigns?limit=200&amp;offset=200&amp;type=email",
      "method": "GET"
    }
  ]
}

Sample Request URL for Push campaigns

/rest/api/v1.3/campaigns?type=push

Tip: Leave the following parameters set to their default values and use the "prev" and "next" links returned in the response to get additional Push campaigns as needed.

Sample Response

{
  "campaigns": [
    {
      "id": 1000,
      "name": "testcampaign-b11",
      "folderName": "testfolder",
      "type": "PUSH",
      "campaignStatus": "ACTIVE",
      "description": "description",
      "purpose": "PROMOTIONAL",
      "marketingStrategy": "strategy",
      "marketingProgram": "program",
      "listName": "listname",
      "channelList": "channelListName",
      "filterPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "refiningDataSourcePath": "foldername/objectName1",
      "proofListPath": "foldername/objectName1",
      "seedListPath": "foldername/objectName1",
      "segmentPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryCampaignDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryLookupDataSourcePaths"[
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryProofDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementarySeedDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "suppressionListPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "subject": "subject",
      "fromName": "from name",
      "fromEmail": "from email",
      "replyToEmail": "reply to email",
      "bccEmail": "bcc email",
      "htmlMessagePath": "documentPath",
      "textMessagePath": "documentPath",
      "enableExternalTracking": true,
      "externalTrackingParams": {
        "name1": "value1",
        "name2": "value2"
      },
      "enableLinkTracking": true,
      "linkTablePath": "foldername/objectName1",
      "attachmentPaths": [
        "documentPath1",
        "documentPath2"
      ],
      "campaignVariables": {
        "name1": "value1",
        "name2": "value2"
      },
      "useUTF8": true,
      "locale": "value",
      "trackHTMLOpens": true,
      "trackConversions": true,
      "sendTextIfHTMLUnknown": true,
      "segmentTrackingColumnName": "name",
      "unsubscribeOption": "OPTOUT_SINGLE_CLICK",
      "unsubscribeFormName": "name",
      "autoCloseOption": "NO_AUTO_CLOSE",
      "autoCloseValue": "value",
      "closedCampaignURL": "URL",
      "externalCampaignCode": "code",
      "salesForceCampaignId": "salesforce id"
    },
    {
      "id": 1001,
      "name": "testcampaign-b12",
      "folderName": "testfolder",
      "type": "PUSH",
      "campaignStatus": "DRAFT",
      "description": "description",
      "purpose": "PROMOTIONAL",
      "marketingStrategy": "strategy",
      "marketingProgram": "program",
      "listName": "listname",
      "channelList": "channelListName",
      "filterPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "refiningDataSourcePath": "foldername/objectName1",
      "proofListPath": "foldername/objectName1",
      "seedListPath": "foldername/objectName1",
      "segmentPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryCampaignDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryLookupDataSourcePaths"[
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementaryProofDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "supplementarySeedDataSourcePaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "suppressionListPaths": [
        "foldername/objectName1",
        "foldername/objectName2"
      ],
      "subject": "subject",
      "fromName": "from name",
      "fromEmail": "from email",
      "replyToEmail": "reply to email",
      "bccEmail": "bcc email",
      "htmlMessagePath": "documentPath",
      "textMessagePath": "documentPath",
      "enableExternalTracking": true,
      "externalTrackingParams": {
        "name1": "value1",
        "name2": "value2"
      },
      "enableLinkTracking": true,
      "linkTablePath": "foldername/objectName1",
      "attachmentPaths": [
        "documentPath1",
        "documentPath2"
      ],
      "campaignVariables": {
        "name1": "value1",
        "name2": "value2"
      },
      "useUTF8": true,
      "locale": "value",
      "trackHTMLOpens": true,
      "trackConversions": true,
      "sendTextIfHTMLUnknown": true,
      "segmentTrackingColumnName": "name",
      "unsubscribeOption": "OPTOUT_SINGLE_CLICK",
      "unsubscribeFormName": "name",
      "autoCloseOption": "NO_AUTO_CLOSE",
      "autoCloseValue": "value",
      "closedCampaignURL": "URL",
      "externalCampaignCode": "code",
      "salesForceCampaignId": "salesforce id"
    }
  ],
  "links": [
    {
      "rel": "self",
      "href": "/rest/api/v1.3/campaigns?type=push",
      "method": "GET"
    },
    {
      "rel": "prev",
      "href": "/rest/api/v1.3/campaigns?limit=200&amp;offset=0&amp;type=push",
      "method": "GET"
    },
    {
      "rel": "next",
      "href": "rest/api/v1.3/campaigns?limit=200&amp;offset=200&amp;type=push",
      "method": "GET"
    }
  ]
}

Sample Request URL for SMS campaigns

/rest/api/v1.3/campaigns?type=sms

Tip: Leave the following parameters set to their default values and use the "prev" and "next" links returned in the response to get additional SMS campaigns as needed.

Sample Response

The endpoint /rest/api/v1.3/campaigns?type=sms returned the following response (in this account, the limit set was for 5 campaigns, but there were only two SMS campaigns for the account):

{
  "campaigns": [
    {
      "id": 1234,
      "name": "SMS_CAMP1",
      "folderName": "Folder1",
      "type": "SMS",
      "campaignStatus": "DRAFT",
      "purpose": "PROMOTIONAL",
      "listName": "R_SMS_LIST1",
      "textMessagePath": "/messagelibrary/sms/13187/Message.txt",
      "enableLinkTracking": false,
      "enableExternalTracking": false,
      "useUTF8": false,
      "trackHTMLOpens": false,
      "trackConversions": false,
      "sendTextIfHTMLUnknown": false,
      "unsubscribeOption": "OPTOUT_SINGLE_CLICK",
      "autoCloseOption": "AUTO_CLOSE_X_DAYS_AFTER_LAST_RESPONSE",
      "autoCloseValue": "90"
    },
    {
      "id": 12345,
      "name": "SMS_CAMP2",
      "folderName": "Folder2",
      "type": "SMS",
      "campaignStatus": "ACTIVE",
      "purpose": "PROMOTIONAL",
      "listName": "R_SMS_LIST2",
      "textMessagePath": "/messagelibrary/sms/13687/Message.txt",
      "enableLinkTracking": false,
      "enableExternalTracking": false,
      "campaignVariables": {
        "SMS_CARRIER": null,
        "SMS_USER_INPUT1": null,
        "SMS_USER_INPUT2": null,
        "SMS_USER_INPUT3": null,
        "SMS_USER_INPUT4": null,
        "SMS_USER_INPUT5": null,
        "SMS_CODE": null,
        "SMS_KEYWORD": " Default"
      },
      "useUTF8": false,
      "trackHTMLOpens": false,
      "trackConversions": false,
      "sendTextIfHTMLUnknown": false,
      "unsubscribeOption": "OPTOUT_SINGLE_CLICK",
      "autoCloseOption": "AUTO_CLOSE_X_DAYS_AFTER_LAST_RESPONSE",
      "autoCloseValue": "90"
    }
  ],
  "links": [
    {
      "rel": "self",
      "href": "/rest/api/v1.3/campaigns?type=sms",
      "method": "GET"
    },
    {
      "rel": "prev",
      "href": "/rest/api/v1.3/campaigns?limit=5&amp;offset=0&amp;type=sms",
      "method": "GET"
    },
    {
      "rel": "next",
      "href": "rest/api/v1.3/campaigns?limit=5&amp;offset=200&amp;type=sms",
      "method": "GET"
    }
  ]
}

Sample Request URL for MMS campaigns

/rest/api/v1.3/campaigns?type=mms

Tip: Leave the following parameters set to their default values and use the "prev" and "next" links returned in the response to get additional MMS campaigns as needed.

Sample Response

{
    "campaigns": [
        {
            "id": 10016762,
            "name": "test-mms",
            "folderName": "examples",
            "type": "MmsCampaign",
            "campaignStatus": "ACTIVE",
            "purpose": "PROMOTIONAL",
            "textMessagePath": "/messagelibrary/mms/10016762/Message.txt",
            "enableLinkTracking": false,
            "attachmentPaths": [
                null
            ],
            "enableExternalTracking": false,
            "useUTF8": false,
            "trackHTMLOpens": false,
            "trackConversions": false,
            "sendTextIfHTMLUnknown": false,
            "autoCloseOption": "None"
        },
		.
		.
		.
        {
            "id": 11081025,
            "name": "AG_AudienceTest_MMS",
            "folderName": "AG-Test",
            "type": "MmsCampaign",
            "campaignStatus": "ACTIVE",
            "purpose": "PROMOTIONAL",
            "listName": "2018 list",
            "textMessagePath": "/messagelibrary/mms/11081025/Message.txt",
            "enableLinkTracking": false,
            "attachmentPaths": [
                "/contentlibrary/2018_content^sale70.jpg"
            ],
            "enableExternalTracking": false,
            "useUTF8": false,
            "trackHTMLOpens": false,
            "trackConversions": false,
            "sendTextIfHTMLUnknown": false,
            "autoCloseOption": "None"
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "/rest/api/v1.3/campaigns?type=mms",
            "method": "GET"
        }
    ]
}

Sample Request URL for Message Center:

/rest/api/v1.3/campaigns?type=pushiocampaign

Tip: Leave the following parameters set to their default values and use the "prev" and "next" links returned in the response to get additional Message Center campaigns as needed.

Sample Response

The response data for Message Center campaigns returns two attributes that are specific to this channel: appName contains the name of the mobile app, and destinationMessageCenter contains the name of the message center to which the marketer wanted the campaign message to be sent.

{
  "campaigns": [
    {
      "id": 11896453,
      "name": "jmp-test-mc-021419",
      "folderName": "jmp-test",
      "type": "PushIOCampaign",
      "campaignStatus": "DRAFT",
      "purpose": "PROMOTIONAL",
      "marketingStrategy": "Other",
      "marketingProgram": "Other",
      "listName": "mmlist",
      "channelList": "mm_APP",
      "appName": "JMP Training App",
      "destinationMessageCenter": "Primary",
      "textMessagePath": "/messagelibrary/push/11896453/Message.txt",
      "enableLinkTracking": false,
      "enableExternalTracking": false,
      "useUTF8": false,
      "trackHTMLOpens": false,
      "trackConversions": false,
      "sendTextIfHTMLUnknown": false
    }
  ],
  "links": [
    {
      "rel": "self",
      "href": "/rest/api/v1.3/campaigns?type=pushiocampaign",
      "method": "GET"
    }
  ]
}