Skip to main content

Overview of the Transactional Messaging with Attachments API

The Transactional Messaging Templates with Attachments API allows you to manage your Transactional Messages with the following capabilities :

  • Create, edit, and delete Transactional Messaging Templates
  • Create and add Standard and Unsubscribe links
  • Send transactional messages that contain attachments and get the send status of transactional messages
info

In order to send transactional messages with attachments, the options must be activated for your account. For more information about activating this feature, please contact your Actito Account Manager.

The following methods are available:

  • Connection

    Method Description
    Open ConnectionThis method provides a session token when given valid credentials.
    Close ConnectionThis method terminates the session token.
  • Transactional Messaging Template Management and Transactional Message Sending

    Method Description
    Create TemplateThis method creates a Transactional Messaging Template.
    Update TemplateThis method updates a Transactional Messaging Template.
    Delete TemplateThis method deletes a Transactional Messaging Template.
    Create Standard LinkThis method creates and adds a standard link to the Template.
    Get TemplateThis method retrieves a Transactional Messaging Template.
    Get LinksThis method returns all links contained in a particular Transactional Messaging Template.
    Get SendersThis method retrieves all Transactional Messaging senders.
    Get Security CodeThis method retrieved the security tags contained in the securityCode field of the Transactional Messaging Template.
    Send RequestThis method sends a Transactional Messaging Template to an email address immediately. When successful, the sendrequest_id is returned.
    Get RequestThis method returns the status on a Transactional Message that has been scheduled to be sent.
info

The Transactional Messaging with Attachments API only supports JSON in the requests.

Attached File Prerequisites:

  • File size permitted
    The total size allowed for a transactional message and its attachments is **20 MB**.
  • Number of attachments permitted
    No more than **5 individual files** can be attached to a transactional message.
  • File formats permitted
    The attached file must be in one of the following formats:
    • .csv
    • .doc
    • .docx
    • .gif
    • .html
    • .jpeg
    • .jpg
    • .pdf
    • .png
    • .xls
    • .xlsx
  • Base64 Encoding
    All files you attach to the transactional message must be encoded in Base64 format.
info

Since Base64 encoded files take up an inordinate amount of visible space in the documentation, the input examples presented in this guide contain the filler text "{encodedFile}" indicating where your Base64 formatted file(s) should be included in the request code.

Transactional Message with Attachment API Use Cases

Create and Send a New Transactional Message with Attachment

To create and send a new Transactional Message with any attachments exclusively using the ATMP API, you would typically carry out the following procedure:

  1. Open Connection: Use the Open Connection method to open the connection and retrieve your session token.
  2. Get Senders (optional): If you do not know the senders that are validated for your account, you can use the Get Senders method to get a list of all validated senders.
    Note:Only sender email addresses with the attachmentEnabled parameter value of true can be used for this API.
  3. Create Template: Use the Create Template method to create a new template, which will contain the content of your transactional message.
    Note: Make sure that your email content contains three ampersands (&&&) for any standard links you may want to include.
  4. Create Standard Link (optional): Use the Create Standard Link method to add a standard link to your transactional message using the template ID (id) that was returned in the output when you created the message with the Create Template method.
  5. Get Security Code (optional): Use the Get Security Code to retrieve the security tags that are required for the Send Request method that will send the transactional message.
  6. Send Request: Use the Send Request method to include the files you want to attach and send the transactional message.
  7. Close Connection: Use the Close Connection method to close the connection once you have finished working with the API.

Manually Obtaining Basic Access Authentication for the Transactional Messaging with Attachment API

To use the Transactional Messaging with Attachment API methods, a basic access authentication is required. The basic access authentication is granted when a valid access token is provided, which is obtained using the Open Connection method. Once you obtain a valid token, you can use any of the other methods. Most HTTP clients natively support basic access authentication such as the curl command line tool. In this case, the value for the username is the token itself and the password is left empty.

If your HTTP client does not directly support basic access authentication, you can manually configure the Authorization header:

  1. Add a colon to the end of your token (e.g., token:)
  2. Encode the resulting string using Base64 (e.g., dG9rZW46Cg==)
  3. Add the prefix Basic followed by one space (e.g., Basic dG9rZW46Cg==)
  4. Set the Authorization header (e.g., Authorization: Basic dG9rZW46Cg==)