Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "mediatoolkit/activecampaign-v3-php",
"description": "PHP Wrapper for ActiveCampaign",
"name": "adrennialbarrett/activecampaign-v3-php",
"type": "library",
"description": "PHP Wrapper for ActiveCampaign (forked from mediatoolkit)",
"require": {
"guzzlehttp/guzzle": "~6.3"
},
Expand All @@ -12,6 +13,10 @@
{
"name": "Mediatoolkit",
"email": "info@mediatoolkit.com"
},
{
"name": "TB",
"email": "thomas.barrett@adrennial.global"
}
],
"autoload": {
Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions src/contacts/Contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,44 @@ public function listAutomations(int $id)
return $req->getBody()->getContents();
}

/**
* Add contact to automation
* @see https://developers.activecampaign.com/reference#create-new-contactautomation
*
* @param int $contact_id
* @param int $automation_id
* @return string
*/
public function addToAutomation( int $contact_id, int $automation_id ){
$req = $this->client
->getClient()
->post( '/api/3/contactAutomations', [
'json' => [
'contactAutomation' => [
'contact' => $contact_id,
'automation' => $automation_id
]
]
]);
return $req->getBody()->getContents();
}

/**
* Get contact custsom field values
* @see https://developers.activecampaign.com/reference#retrieve-contact-field-values
*
* @param int $contact_id
* @return string
*/
public function getCustomFieldValues( int $contact_id ){
$req = $this->client
->getClient()
->get( '/api/3/contacts/' . $contact_id . '/fieldValues' );

return $req->getBody()->getContents();
}


/**
* Add a tag to contact
* @see https://developers.activecampaign.com/reference#create-contact-tag
Expand Down