From d127dc360307e6ac0ece27bf67d74974b5abfe22 Mon Sep 17 00:00:00 2001 From: Antun Tomasevic Date: Tue, 5 Feb 2019 11:51:31 +0100 Subject: [PATCH] New methods available for Contacts and Deals --- src/contacts/Contacts.php | 15 +++++++++++++ src/deals/Deals.php | 45 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/src/contacts/Contacts.php b/src/contacts/Contacts.php index 9d3c867..977a1bb 100644 --- a/src/contacts/Contacts.php +++ b/src/contacts/Contacts.php @@ -305,4 +305,19 @@ public function deleteCustomFieldValue(int $field_value_id) return 200 === $req->getStatusCode(); } + /** + * Remove contact from automation + * @see https://developers.activecampaign.com/reference#delete-a-contactautomation + * @param int $contactAutomationId + * @return bool + */ + public function removeAutomation(int $contactAutomationId) + { + $req = $this->client + ->getClient() + ->delete('/api/3/contactAutomation/' . $contactAutomationId); + + return 200 === $req->getStatusCode(); + } + } \ No newline at end of file diff --git a/src/deals/Deals.php b/src/deals/Deals.php index 9349724..6830e13 100644 --- a/src/deals/Deals.php +++ b/src/deals/Deals.php @@ -201,4 +201,49 @@ public function listAllCustomFields() return $req->getBody()->getContents(); } + /** + * List all custom field values + * @see https://developers.activecampaign.com/reference#list-all-custom-field-values + * @param array $query_params + * @return string + */ + public function listAllCustomFieldValues(array $query_params) + { + $req = $this->client + ->getClient() + ->get('/api/3/dealCustomFieldData', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** + * List all pipelines + * @see https://developers.activecampaign.com/reference#list-all-pipelines + * @return string + */ + public function listAllPipelines() + { + $req = $this->client + ->getClient() + ->get('/api/3/dealGroups'); + + return $req->getBody()->getContents(); + } + + /** + * List all stages + * @see https://developers.activecampaign.com/reference#list-all-deal-stages + * @return string + */ + public function listAllStages() + { + $req = $this->client + ->getClient() + ->get('/api/3/dealStages'); + + return $req->getBody()->getContents(); + } + } \ No newline at end of file