Trigger email message with attachments

Use this interface to trigger email messages to existing members of a profile list.

IMPORTANT: This is a controlled feature. To have this API enabled for your account, contact your Customer Success Manager (CSM).

REQUEST NOTES:

  • The API payload can trigger each batched recipient with their own attachment(s), or with no attachments. To send an email campaign to a recipient that does not include attachments, omit the attachmentData array from the recipient object. (If you send null values in the attachmentData array, the email for the recipient fails with the invalid attachment type error message.)

  • Each attachment must be Base-64 encoded in the API payload. Any personalization of attachments must happen before your client application includes the attachment in the API payload.

  • Default allowed file types are JPEG and JPG, PDF, and ICAL. Ensure that the extension is the correct type for the decoded file, otherwise the recipient will receive the attachment but not be able to open it.

  • If attachments are already configured in the campaign that the API request will trigger, the email sent will include those attachments plus the attachments sent in the API request.

    • Each email can contain a maximum of 10 attachments total (campaign + API payload).

    • Total size of all attachments for a single email is limited to 500 KB.

  • Data attached by the API are scanned before the system creates the files on the server.

  • Use the Get Throttling Limits API to determine how many API requests you can send per minute. A successful response will return a limit, which is how many API requests you can send per minute for this API endpoint.

As with Merge Trigger Email, the following also apply to Merge Trigger Email with Attachments:

  • You can send Responsys Email campaigns that already exist to up to 5 members of a profile list.

  • For the list associated with the specified Email campaign, you must specify an array of record data that contain field names and their corresponding field values.

  • Do not use system column names for the optional data, such as EMAIL_ADDRESS_. This may cause incorrect data to be processed, possibly resulting in skipped records and incorrect data being recorded in the Event table.

  • To pass extended/accented characters in optionalData payload, they must be escaped as Unicode characters. For example, the euro symbol is escaped as \u20AC, the yen symbol is escaped as \u00A5, an is escaped as \u00FC, an is escaped as \u00E9, and the like. Otherwise, you may receive an INVALID_REQUEST_CONTENT error. Please see the definition of merge rule parameters provided in section "Definitions of Rule Parameters for Merging Members into a Profile List".

 

Service URL:

/rest/api/v1.3/campaigns/{campaignName}/emailAttachments/actions/trigger

Required Path Parameter:

campaignName - Email campaign name to send.

Request Method:

POST

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Sample Request Body:

{
  "recipientData": [
    {
      "recipient": {
        "emailAddress": "api.user@oracle.com",
        "recipientId": <recipientId>,
        "mobileNumber": "1608777777",
        "customerId": "<customerId>",
        "emailMD5Hash": "<emailMD5Hash>",
        "emailSHA256Hash": "<emailSHA256Hash>"
      },
      "optionalData": [
        {
          "name": "CUSTOM1",
          "value": "<example_value>"
        },
        {
          "name": "CUSTOM2",
          "value": "<example_value>"
        }
      ],
      "attachmentData": [
        {
          "name": "CSV_Attachment",
          "value": "<csvData>"
        },
        {
          "name": "CSV_Attachment",
          "value": "<csvData>"
        }
      ]
    },
    {
      "recipient": {
        "emailAddress": "",
        "recipientId": "3736015741",
        "mobileNumber": null,
        "customerId": null,
        "emailMD5Hash": null,
        "emailSHA256Hash": null
      },
      "optionalData": [
        {
          "name": "CUSTOM1",
          "value": "<sampleValue>"
        },
        {
          "name": "CUSTOM2",
          "value": "<sampleValue>"
        }
      ],
      "attachmentData": [
        {
          "name": "attachment1.jpeg",
          "value": "abc"
        }
      ]
    }
  ]
}

Sample Response:

The response returns a status for each record sent in the request. In this example, email was sent successfully to the recipient whose RIID is 72067. For the second record, the trigger email action was not successful, because the recipient’s deliverability status was undeliverable.

[
  {
    "errorMessage": null,
    "success": true,
    "recipientId": 72067
  },
  {
    "errorMessage": ”RECIPIENT_STATUS_UNDELIVERABLE: Recipientdeliverabilitystatusisundeliverable”,
    "success": false,
    "recipientId": -1
  }
]

Learn more

APIs