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 Contacts in ActiveCampaign



Overview

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

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

OperationDescription

createContact

Creates a new contact.

getContactByEmailRetrieves a contact by e-mail.

Operation details

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

Creating a new contact

The createContact operation creates a new contact.

createContact
<activecampaign.createContact>
    <email>{$ctx:email}</email>
    <firstName>{$ctx:firstName}</firstName>
    <lastName>{$ctx:lastName}</lastName>
    <phone>{$ctx:phone}</phone>
    <orgName>{$ctx:orgName}</orgName>
    <tags>{$ctx:tags}</tags>
    <ip4>{$ctx:ip4}</ip4>
    <form>{$ctx:form}</form>
	<listDetails>{$ctx:listDetails}</listDetails>
</activecampaign.createContact>
Properties
  • email: The e-mail of the new contact.
  • firstName: The first name of the contact.
  • lastName: The last name of the contact.
  • phone: The telephone number of the contact.
  • orgName: The organization name (if it does not exist, this will create a new organization).
  • tags: Tags for this contact (comma-separated).
  • ip4: The IP address of the contact. Default: 127.0.0.1
  • form: The optional subscription form ID to inherit those redirection settings.
  • listDetails: All the details of lists this contact belongs to.
Sample request

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

Sample Request for createContact
{
	"apiUrl":"http://wso2.api-us1.com",
	"apiKey":"eaae213ef1b8d842aba960423308c2e516d7704b95be8899fae897a1580a40e0a5cea198",
	"apiOutput":"json",
	"email":"wso2connector123.abdera@gmail.com",
	"firstName":"Randika",
	"lastName":"Rodrigo",
	"phone":"+942788087",
	"orgName":"Virtusa",
	"tags":"Tag Contact",
	"ip4":"192.22.210.125",
	"form":"14",
	"listDetails":{
	"p[1]":"1",
	"status[1]":"1",
	"noresponders[1]":"0",
	"sdate[1]":"2015-05-07 06:00:00",
	"instantresponders[1]":"0",
	"lastmessage[1]":"0",
	"field[1,0]":"Custom1 Value",
	"field[%CUSTOM2%,0]":"Custom2 Value"
				  }
}
Related ActiveCampaign documentation

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

Retrieving a contact by e-mail

The getContactByEmail operation retrieves a contact by e-mail.

getContactByEmail
<activecampaign.getContactByEmail>
	<email>{$ctx:email}</email>
</activecampaign.getContactByEmail>
Properties
  • email: The e-mail address of the contact being looked up.
Sample request

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

getContactByEmail
{
	"apiUrl":"http://wso2.api-us1.com",
	"apiKey":"eaae213ef1b8d842aba960423308c2e516d7704b95be8899fae897a1580a40e0a5cea198",
	"apiOutput":"json",
	"email":"wso2connector.abdera@gmail.com"
}
Related ActiveCampaign documentation

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

Sample configuration

Following is a sample proxy service that illustrates how to connect to ActiveCampaign with the init operation and use the createContact operation. The sample request for this proxy can be found in the createContact 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_createContact"
       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="email" expression="json-eval($.email)"/>
         <property name="firstName" expression="json-eval($.firstName)"/>
         <property name="lastName" expression="json-eval($.lastName)"/>
         <property name="phone" expression="json-eval($.phone)"/>
         <property name="orgName" expression="json-eval($.orgName)"/>
         <property name="tags" expression="json-eval($.tags)"/>
         <property name="ip4" expression="json-eval($.ip4)"/>
         <property name="form" expression="json-eval($.form)"/>
         <property name="listDetails" expression="json-eval($.listDetails)"/>
         <activecampaign.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
            <apiOutput>{$ctx:apiOutput}</apiOutput>
         </activecampaign.init>
         <activecampaign.createContact>
            <email>{$ctx:email}</email>
            <firstName>{$ctx:firstName}</firstName>
            <lastName>{$ctx:lastName}</lastName>
            <phone>{$ctx:phone}</phone>
            <orgName>{$ctx:orgName}</orgName>
            <tags>{$ctx:tags}</tags>
            <ip4>{$ctx:ip4}</ip4>
            <form>{$ctx:form}</form>
            <listDetails>{$ctx:listDetails}</listDetails>
         </activecampaign.createContact>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>