I would like to build a custom form, so when a user signs up through active campaign they are then presented with a second form. With the second form they can choose which categories they want to recieve emails for.
I have done some research and think I have to use the API provided by active campaign, but I have no idea how to go about it.
This is their API http://www.activecampaign.com/api/overview.php
Anyone got any pointers for me to get me started. Cheers
You can build that directly through the Form editor, no need to do it through the API. Create 2 forms, in the first form > Options > On submit > Include the direct link of the 2nd form, so once the contact submits the first form he will be redirected to the 2nd form.
If you don't want the contact to include the email in the 2nd form because you got it already in the first form, in the on submit URL of the first form include:
http://your-account.activehosted.com/f/yourformID?email=%EMAIL% so that prepopulates the email field.
To work with Active Campaign API you need to get basic chunk of code from here or also can directly install it using composer. https://github.com/ActiveCampaign/activecampaign-api-php
Once you integrate it you will be needed below code to get access to the user account and then you will be able to get lists/campaigns etc o show user to select from. https://www.activecampaign.com/api/overview.php
$ac = new ActiveCampaign(USER_API_URL,USER_API_KEY);
$result = $ac->api("account/view");
if(isset($result->result_code) && $result->result_code == 1)
{
// here you will able to get further lists, campaigns etc for all API actions
// for eg to add a new list :- $result = $ac->api("list/add",$params);
// $params will be required elements array
}