This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Messages in ActiveCampaign



Overview

The following operations allow you to work with messages. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with messages, see Sample configuration

OperationDescription

createMessage

Creates a new e-mail message in the system.

getMessageByIdRetrieves a message.
listMessagesRetrieves all messages.

Operation details

This section provides further details on the operations related to messages.

Creating a plan

The createMessage operation creates a new e-mail message in the system.

createMessage
 <activecampaign.createMessage>
    <format>{$ctx:format}</format>
    <subject>{$ctx:subject}</subject>
    <fromEmail>{$ctx:fromEmail}</fromEmail>
    <fromName>{$ctx:fromName}</fromName>
    <replyTo>{$ctx:replyTo}</replyTo>
    <priority>{$ctx:priority}</priority>
    <charset>{$ctx:charset}</charset>
    <encoding>{$ctx:encoding}</encoding>
    <htmlConstructor>{$ctx:htmlConstructor}</htmlConstructor>
    <html>{$ctx:html}</html>
    <htmlFetch>{$ctx:htmlFetch}</htmlFetch>
    <htmlFetchWhen>{$ctx:htmlFetchWhen}</htmlFetchWhen>
    <messageUploadHtml>{$ctx:messageUploadHtml}</messageUploadHtml>
    <textConstructor>{$ctx:textConstructor}</textConstructor>
    <text>{$ctx:text}</text>
    <textFetch>{$ctx:textFetch}</textFetch>
    <textFetchWhen>{$ctx:textFetchWhen}</textFetchWhen>
    <messageUploadText>{$ctx:messageUploadText}</messageUploadText>
   	<attach>{$ctx:attach}</attach>
	<listIds>{$ctx:listIds}</listIds>
</activecampaign.createMessage>
Properties
  • format: The format of the message.
  • subject: The subject of the message.
  • fromEmail: The e-mail address of the sender.
  • fromName: The name of the sender.
  • replyTo: The e-mail address that recipients should reply to.
  • priority: The priority of the message.
  • charset: The character set used.
  • encoding: The encoding type used.
  • htmlConstructor: Indicates whether to use "editor", "external" or "upload".
  • html: If htmlConstructor is "html", gives the content of your HTML e-mail address.
  • htmlFetch: If htmlConstructor is "external", gives the URL to fetch the e-mail address from.
  • htmlFetchWhen: If htmlConstructor is "external", informs when to fetch the e-mail address.
  • messageUploadHtml: HTML version. Not supported yet: an ID of uploaded content.
  • textConstructor: Indicates whether to use "editor", "external" or "upload".
  • text: If textConstructor is "editor", gives the content of your text only e-mail address.
  • textFetch: If textConstructor is "external", gives the URL to fetch the body from.
  • textFetchWhen: If textConstructor is "external", informs when to fetch the e-mail address.
  • messageUploadText: Text version. Not supported yet: an ID of uploaded content
  • attachNot supported yet: an ID of an uploaded file.
  • listIds: The list of IDs.
Sample request

Following is a sample REST/JSON request that can be handled by the createMessage operation.

Sample Request for createMessage
{
	"apiUrl":"http://anusoft.api-us1.com",
	"apiKey":"32dc630082287cb074342f151370929a8c36adaf80eacac7c1d3b03fdb0e8d8382aab80f",
	"apiOutput":"json",
	"format" : "text",
	"subject" : "testing from soapui 1",
	"fromEmail" : "anu.thushi@gmail.com",
	"fromName" : "Chamath",
	"replyTo" : "anu.thushi@gmail.com",
	"priority" : "1",
	"charset" : "utf-8",
	"encoding" : "quoted-printable",
	"htmlConstructor" : "editor",
	"html" : "chamath",
	"htmlFetch" : "",
	"htmlFetchWhen" : "",
	"textConstructor" : "editor",
	"text" : "https://www.google.lk",
	"textFetch" : "",
	"textFetchWhen" : "",
	"listIds" : {
		"p[1]":1,
		"p[2]":2
	}
}
Related ActiveCampaign documentation

http://www.activecampaign.com/api/example.php?call=message_add

Retrieving a message

The getMessageById operation retrieves a message by ID.

getMessageById
<activecampaign.getMessageById>
	<id>{$ctx:id}</id>
</activecampaign.getMessageById>
Properties
  • id: The ID of the message.
Sample request

Following is a sample REST/JSON request that can be handled by the getMessageById operation.

getMessageById
{
	"apiUrl":"http://anusoft.api-us1.com",
	"apiKey":"32dc630082287cb074342f151370929a8c36adaf80eacac7c1d3b03fdb0e8d8382aab80f",
	"apiOutput":"json",
	"id" : ""
}
Related ActiveCampaign documentation

http://www.activecampaign.com/api/example.php?call=message_view

Retrieving all messages

The listMessages operation retrieves all messages.

listMessages
<activecampaign.listMessages>
   	<ids>{$ctx:ids}</ids>
	<page>{$ctx:page}</page>
</activecampaign.listMessages>
Properties
  • ids: The IDs of the messages.
  • page: The number of the page.
Sample request

Following is a sample REST/JSON request that can be handled by the listMessages operation.

listMessages
{
	"apiUrl":"http://anusoft.api-us1.com",
	"apiKey":"32dc630082287cb074342f151370929a8c36adaf80eacac7c1d3b03fdb0e8d8382aab80f",
	"apiOutput":"json",
	"ids" : "all",
	"page" : ""
}
Related ActiveCampaign documentation

http://www.activecampaign.com/api/example.php?call=message_list

Sample configuration

Following is a sample proxy service that illustrates how to connect to ActiveCampaign with the init operation and use the createMessage operation. The sample request for this proxy can be found in the createMessage sample request. You can use this sample as a template for using other operations in this category.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="activecampaign_createMessage"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiKey" expression="json-eval($.apiKey)"/>
         <property name="apiOutput" expression="json-eval($.apiOutput)"/>
         <property name="format" expression="json-eval($.format)"/>
         <property name="subject" expression="json-eval($.subject)"/>
         <property name="fromEmail" expression="json-eval($.fromEmail)"/>
         <property name="fromName" expression="json-eval($.fromName)"/>
         <property name="replyTo" expression="json-eval($.replyTo)"/>
         <property name="priority" expression="json-eval($.priority)"/>
         <property name="charset" expression="json-eval($.charset)"/>
         <property name="encoding" expression="json-eval($.encoding)"/>
         <property name="htmlConstructor" expression="json-eval($.htmlConstructor)"/>
         <property name="html" expression="json-eval($.html)"/>
         <property name="htmlFetch" expression="json-eval($.htmlFetch)"/>
         <property name="htmlFetchWhen" expression="json-eval($.htmlFetchWhen)"/>
         <property name="textConstructor" expression="json-eval($.textConstructor)"/>
         <property name="text" expression="json-eval($.text)"/>
         <property name="textFetch" expression="json-eval($.textFetch)"/>
         <property name="textFetchWhen" expression="json-eval($.textFetchWhen)"/>
         <property name="listIds" expression="json-eval($.listIds)"/>
         <activecampaign.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
            <apiOutput>{$ctx:apiOutput}</apiOutput>
         </activecampaign.init>
         <activecampaign.createMessage>
            <format>{$ctx:format}</format>
            <subject>{$ctx:subject}</subject>
            <fromEmail>{$ctx:fromEmail}</fromEmail>
            <fromName>{$ctx:fromName}</fromName>
            <replyTo>{$ctx:replyTo}</replyTo>
            <priority>{$ctx:priority}</priority>
            <charset>{$ctx:charset}</charset>
            <encoding>{$ctx:encoding}</encoding>
            <htmlConstructor>{$ctx:htmlConstructor}</htmlConstructor>
            <html>{$ctx:html}</html>
            <htmlFetch>{$ctx:htmlFetch}</htmlFetch>
            <htmlFetchWhen>{$ctx:htmlFetchWhen}</htmlFetchWhen>
            <messageUploadHtml>{$ctx:messageUploadHtml}</messageUploadHtml>
            <textConstructor>{$ctx:textConstructor}</textConstructor>
            <text>{$ctx:text}</text>
            <textFetch>{$ctx:textFetch}</textFetch>
            <textFetchWhen>{$ctx:textFetchWhen}</textFetchWhen>
            <messageUploadText>{$ctx:messageUploadText}</messageUploadText>
            <attach>{$ctx:attach}</attach>
            <listIds>{$ctx:listIds}</listIds>
         </activecampaign.createMessage>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>