The Add to Lifecycle Campaign command allows you to add one or more existing contacts to the beginning of a Lifecycle Campaign.
Arguments
The Add to Lifecycle Campaign command requires the following arguments: Command, Realm, Password, Lifecycle Campaign Name, and Data.
api_web?r=myrealm&p=mypass&c=addtolifecyclecampaign&lc_campaign_name=mylccampaign&data=email^john.smith@domain.com
The command is ‘addtolifecyclecampaign', the realm is ‘myrealm’ and the password is ‘mypass’. The existing contact with email 'john.smith@domain.com' will be added to the Lifecycle Campaign named 'mylccampaign'. If the campaign is active, the contact will move through the Lifecycle Campaign flow immediately. If the campaign is not active, the email will be added to the next batch to run when the campaign is activated again.
The command expects as least one field in the Data argument. The email address of an existing contact is always required to add contact to a Lifecycle Campaign.
The Add to Lifecycle Campaign command supports the following arguments:
Name |
Req? |
Description |
Argument |
Command |
Yes |
Defines the command to use. |
cmd= addtolifecyclecampaign c= addtolifecyclecampaign |
Realm |
Yes |
Name of the realm to run the command. This is required, and the command will fail if the realm and password do not match. |
realm=[realm_name] r=[realm_name] |
Password |
Yes |
Authentication code for API access. This is required, and the command will fail if the realm and password do not match. |
pwd=[password] p=[password] |
Lifecycle Campaign Name |
Yes |
Identifier of the Lifecycle Campaign to apply the command. |
lc_campaign_name=[lc_campaign_name] |
Data | Yes | Contact related data. Email is always required, and first name field is optional. |
data=[fields] d=[fields] |
Example
Using all commands and arguments (please note the command is wrapped for display purposes only):
api_web?r=myrealm&p=mypass&c=addtolifecyclecampaign&lc_campaign_name=welcome&data=email,first^john.doe@mydomain.com,john
One contact will be added to Lifecycle Campaign named 'welcome'.
Successful results return:
SUCCESS: 1 record(s) processed. 1 users added to Lifecycle Campaign welcome
To add multiple contacts in the same command, separate each data group using the '^':
api_web?r=myrealm&p=mypass&c=addtolifecyclecampaign&lc_campaign_name=welcome&data=email,first^john.doe@mydomain.com,john^jane.doe@mydomain.com,jane^jack.doe@mydomain.com,jack
Successful results return:
SUCCESS: 1 record(s) processed. 1 users added to Lifecycle Campaign welcome
Customer Key Example
Some systems have the ability to define a unique Customer Key per contact. If your realm has Customer Key enabled, then you must include the customer_key in the data argument. The email data field is optional in this instance. For example:
api_web?r=myrealm&p=mypass&c=addtolifecyclecampaign&lc_campaign_name=welcome&data=customer_key^jd123
or
api_web?r=myrealm&p=mypass&c=addtolifecyclecampaign&lc_campaign_name=welcome&data=customer_key,email^jd123,john.doe@mydomain.com
If the Customer Key is not included, the command will fail.
Results
The Add to Lifecycle Campaign command outputs either a SUCCESS or FAILURE message.
SUCCESS
The Add to Lifecycle Campaigncommand success message returns the SUCCESS message and includes the number of records processed and the lifecycle campaign name. The result format is:
SUCCESS: [number sent] record(s) processed. [number added] users added to Lifecycle Campaign [lc_campaign_name]
If the Add to Lifecycle Campaigncommand includes records for more than one contact, all matching contacts will be added. The result only indicates the total number and does not return errors or reasons why some may have failed.
FAILURE
A Add to Lifecycle Campaign command will fail for several reasons. The result format is:
FAILURE: [Reason]