diff --git a/src/Contacts/Contacts.php b/src/Contacts/Contacts.php new file mode 100644 index 0000000..a6a8894 --- /dev/null +++ b/src/Contacts/Contacts.php @@ -0,0 +1,349 @@ +client + ->getClient() + ->post('/api/3/contacts', [ + 'json' => [ + 'contact' => $contact + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Create or update contact + * @see https://developers.activecampaign.com/reference#create-contact-sync + * + * @param array $contact + * @return string + */ + public function sync(array $contact) + { + $req = $this->client + ->getClient() + ->post('/api/3/contact/sync', [ + 'json' => [ + 'contact' => $contact + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Get contact + * @see https://developers.activecampaign.com/reference#get-contact + * + * @param int $id + * @return string + */ + public function get(int $id) + { + $req = $this->client + ->getClient() + ->get('/api/3/contacts/' . $id); + + return $req->getBody()->getContents(); + } + + /** + * Update list status for a contact + * @see https://developers.activecampaign.com/reference#update-list-status-for-contact + * + * @param array $contact_list + * @return string + */ + public function updateListStatus(array $contact_list) + { + $req = $this->client + ->getClient() + ->post('/api/3/contactLists', [ + 'json' => [ + 'contactList' => $contact_list + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Update a contact + * @see https://developers.activecampaign.com/reference#update-a-contact + * + * @param int $id + * @param array $contact + * @return string + */ + public function update(int $id, array $contact) + { + $req = $this->client + ->getClient() + ->put('/api/3/contacts/' . $id, [ + 'json' => [ + 'contact' => $contact + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete a contact + * @see https://developers.activecampaign.com/reference#delete-contact + * + * @param int $id + * @return string + */ + public function delete(int $id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/contacts/' . $id); + + return 200 === $req->getStatusCode(); + } + + /** + * List all automations the contact is in + * @see https://developers.activecampaign.com/reference#list-all-contactautomations-for-contact + * + * @param int $id + * @return string + */ + public function listAutomations(int $id) + { + $req = $this->client + ->getClient() + ->get('/api/3/contacts/' . $id . '/contactAutomations'); + + return $req->getBody()->getContents(); + } + + /** + * Add a contact to an automation + * @see https://developers.activecampaign.com/reference#create-new-contactautomation + * + * @param int $contact_id + * @param int $automation_id + * @return string + */ + public function triggerAutomation(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(); + } + + /** + * Add a tag to contact + * @see https://developers.activecampaign.com/reference#create-contact-tag + * + * @param int $id + * @param int $tag_id + * @return string + */ + public function tag(int $id, int $tag_id) + { + $req = $this->client + ->getClient() + ->post('/api/3/contactTags', [ + 'json' => [ + 'contactTag' => [ + 'contact' => $id, + 'tag' => $tag_id + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Remove a tag from a contact + * @see https://developers.activecampaign.com/reference#delete-contact-tag + * + * @param int $contact_tag_id + * @return string + */ + public function untag(int $contact_tag_id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/contactTags/' . $contact_tag_id); + + return $req->getBody()->getContents(); + } + + /** + * List all contacts + * @see https://developers.activecampaign.com/reference#list-all-contacts + * + * @param array $query_params + * @param int $limit + * @param int $offset + * @return string + */ + public function listAll(array $query_params = [], int $limit = 20, int $offset = 0) + { + $query_params = array_merge($query_params, [ + 'limit' => $limit, + 'offset' => $offset + ]); + + $req = $this->client + ->getClient() + ->get('/api/3/contacts', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** + * List all custom fields + * @see https://developers.activecampaign.com/v3/reference#retrieve-fields-1 + * @param array $query_params + * @return string + */ + public function listAllCustomFields(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('/api/3/fields', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** + * Create a custom field value + * @see https://developers.activecampaign.com/v3/reference#create-fieldvalue + * + * @param int $contact_id + * @param int $field_id + * @param string $field_value + * @return string + */ + public function createCustomFieldValue(int $contact_id, int $field_id, string $field_value) + { + $req = $this->client + ->getClient() + ->post('/api/3/fieldValues', [ + 'json' => [ + 'fieldValue' => [ + 'contact' => $contact_id, + 'field' => $field_id, + 'value' => $field_value + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Retrieve a custom field value + * @see https://developers.activecampaign.com/v3/reference#retrieve-a-fieldvalues + * + * @param int $field_id + * @return string + */ + public function retrieveCustomFieldValue(int $field_id) + { + $req = $this->client + ->getClient() + ->get('/api/3/fieldValues/' . $field_id); + + return $req->getBody()->getContents(); + } + + /** + * Update a custom field value + * @see https://developers.activecampaign.com/v3/reference#update-a-custom-field-value-for-contact + * + * @param int $field_value_id + * @param int $contact_id + * @param int $field_id + * @param string $field_value + * @return string + */ + public function updateCustomFieldValue(int $field_value_id, int $contact_id, int $field_id, string $field_value) + { + $req = $this->client + ->getClient() + ->put('/api/3/fieldValues/' . $field_value_id, [ + 'json' => [ + 'fieldValue' => [ + 'contact' => $contact_id, + 'field' => $field_id, + 'value' => $field_value + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete a custom field value + * @see https://developers.activecampaign.com/v3/reference#delete-a-fieldvalue-1 + * + * @param int $field_value_id + * @return bool + */ + public function deleteCustomFieldValue(int $field_value_id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/fieldValues/' . $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(); + } + +} diff --git a/src/Deals/Deals.php b/src/Deals/Deals.php new file mode 100644 index 0000000..7a468ec --- /dev/null +++ b/src/Deals/Deals.php @@ -0,0 +1,258 @@ +client + ->getClient() + ->post('/api/3/deals', [ + 'json' => [ + 'deal' => $deal + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Get a deal by id + * @see https://developers.activecampaign.com/reference#retrieve-a-deal + * + * @param int $id + * @return string + */ + public function get(int $id) + { + $req = $this->client + ->getClient() + ->get('/api/3/deals/' . $id); + + return $req->getBody()->getContents(); + } + + /** + * Update a deal + * @see https://developers.activecampaign.com/reference#update-a-deal + * + * @param int $id + * @param array $deal + * @return string + */ + public function update(int $id, array $deal) + { + $req = $this->client + ->getClient() + ->put('/api/3/deals/' . $id, [ + 'json' => [ + 'deal' => $deal + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete a deal by id + * @see https://developers.activecampaign.com/reference#delete-a-deal + * + * @param int $id + * @return string + */ + public function delete(int $id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/deals/' . $id); + + return $req->getBody()->getContents(); + } + + /** + * Move deals to another stage + * @see https://developers.activecampaign.com/reference#move-deals-to-another-deal-stage + * + * @param int $id + * @param array $deal + * @return string + */ + public function moveToStage(int $id, array $deal) + { + $req = $this->client + ->getClient() + ->put('/api/3/dealStages/' . $id . '/deals', [ + 'json' => [ + 'deal' => $deal + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Create a deal custom field value + * @see https://developers.activecampaign.com/v3/reference#create-dealcustomfielddata-resource + * + * @param int $deal_id + * @param int $field_id + * @param $field_value + * @return string + */ + public function createCustomFieldValue(int $deal_id, int $field_id, $field_value) + { + $req = $this->client + ->getClient() + ->post('/api/3/dealCustomFieldData', [ + 'json' => [ + 'dealCustomFieldDatum' => [ + 'dealId' => $deal_id, + 'custom_field_id' => $field_id, + 'fieldValue' => $field_value + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Retrieve a custom field value + * @see https://developers.activecampaign.com/v3/reference#retrieve-a-dealcustomfielddata + * @param int $custom_field_id + * @return string + */ + public function retrieveCustomFieldValue(int $custom_field_id) + { + $req = $this->client + ->getClient() + ->get('/api/3/dealCustomFieldData/' . $custom_field_id); + + return $req->getBody()->getContents(); + } + + /** + * Update a custom field value + * @see https://developers.activecampaign.com/v3/reference#update-a-dealcustomfielddata-resource + * + * @param int $custom_field_id + * @param $field_value + * @return string + */ + public function updateCustomFieldValue(int $custom_field_id, $field_value) + { + $req = $this->client + ->getClient() + ->put('/api/3/dealCustomFieldData/' . $custom_field_id, [ + 'json' => [ + 'dealCustomFieldDatum' => [ + 'fieldValue' => $field_value + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete a custom field value + * @see https://developers.activecampaign.com/v3/reference#retrieve-a-dealcustomfielddata-resource + * + * @param int $custom_field_id + * @return string + */ + public function deleteCustomFieldValue(int $custom_field_id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/dealCustomFieldData/' . $custom_field_id); + + return $req->getBody()->getContents(); + } + + /** + * List all custom fields + * @see https://developers.activecampaign.com/reference#retrieve-all-dealcustomfielddata-resources + * @param array $query_params + * @return string + */ + public function listAllCustomFields(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('/api/3/dealCustomFieldMeta', [ + 'query' => $query_params + ]); + + 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 + * @param array $query_params + * @return string + */ + public function listAllPipelines(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('/api/3/dealGroups', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** + * List all stages + * @see https://developers.activecampaign.com/reference#list-all-deal-stages + * @param array $query_params + * @return string + */ + public function listAllStages(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('/api/3/dealStages', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + +} \ No newline at end of file diff --git a/src/Lists/Lists.php b/src/Lists/Lists.php new file mode 100644 index 0000000..94d8d47 --- /dev/null +++ b/src/Lists/Lists.php @@ -0,0 +1,72 @@ +client + ->getClient() + ->post('/api/3/lists', [ + 'json' => [ + 'list' => $list + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Retrieve all lists or a list when id is not null + * @see https://developers.activecampaign.com/reference#retrieve-a-list + * @param null $id + * @param array $query_params + * @return string + */ + public function retrieve($id = null, array $query_params = []) + { + $uri = '/api/3/lists'; + if (!is_null($id)) { + $uri .= '/' . $id; + } + $req = $this->client + ->getClient() + ->get($uri, [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete a list + * @see https://developers.activecampaign.com/reference#delete-a-list + * @param $id + * @return string + */ + public function delete($id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/lists/' . $id); + + return $req->getBody()->getContents(); + } + +} \ No newline at end of file diff --git a/src/Organizations/Organizations.php b/src/Organizations/Organizations.php new file mode 100644 index 0000000..f8c115a --- /dev/null +++ b/src/Organizations/Organizations.php @@ -0,0 +1,125 @@ +client + ->getClient() + ->post('/api/3/organizations', [ + 'json' => [ + 'organization' => $organization + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Get an organization + * @see https://developers.activecampaign.com/reference#get-organization + * + * @param int $id + * @return string + */ + public function get(int $id) + { + $req = $this->client + ->getClient() + ->get('/api/3/organizations/' . $id); + + return $req->getBody()->getContents(); + } + + /** + * Update an organization + * @see https://developers.activecampaign.com/reference#update-organization + * + * @param int $id + * @param array $organization + * @return string + */ + public function update(int $id, array $organization) + { + $req = $this->client + ->getClient() + ->put('/api/3/organizations/' . $id, [ + 'json' => [ + 'organization' => $organization + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete an organization + * @see https://developers.activecampaign.com/reference#delete-organization + * + * @param int $id + * @return string + */ + public function delete(int $id) + { + $req = $this->client + ->getClient() + ->delete('/api/3/organizations/' . $id); + + return $req->getBody()->getContents(); + } + + /** + * Delete multiple organizations + * @see https://developers.activecampaign.com/reference#delete-multiple-organizations + * + * @param array $ids + * @return string + */ + public function bulkDelete(array $ids) + { + $req = $this->client + ->getClient() + ->delete('/api/3/organizations/bulk_delete', [ + 'query' => [ + 'ids' => $ids + ] + ]); + + return $req->getBody()->getContents(); + } + + public function listAll(array $query_params = [], $limit = 20, $offset = 0) + { + $query_params = array_merge($query_params, [ + 'limit' => $limit, + 'offset' => $offset + ]); + + $req = $this->client + ->getClient() + ->get('/api/3/organizations', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + +} \ No newline at end of file diff --git a/src/Tags/Tags.php b/src/Tags/Tags.php new file mode 100644 index 0000000..f8c2312 --- /dev/null +++ b/src/Tags/Tags.php @@ -0,0 +1,32 @@ +client + ->getClient() + ->get('/api/3/tags', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + +} \ No newline at end of file diff --git a/src/Tracking/EventTracking.php b/src/Tracking/EventTracking.php new file mode 100644 index 0000000..7b4f3ad --- /dev/null +++ b/src/Tracking/EventTracking.php @@ -0,0 +1,142 @@ +client + ->getClient() + ->get('api/3/eventTracking'); + + return $req->getBody()->getContents(); + } + + /** + * Create a new event + * @see https://developers.activecampaign.com/v3/reference#create-a-new-event-name-only + * @param string $event_name + * @return string + */ + public function createEvent(string $event_name) + { + $req = $this->client + ->getClient() + ->post('/api/3/eventTrackingEvents', [ + 'json' => [ + 'eventTrackingEvent' => [ + 'name' => $event_name + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * Delete event + * @see https://developers.activecampaign.com/v3/reference#remove-event-name-only + * + * @param string $event_name + * @return bool + */ + public function deleteEvent(string $event_name) + { + $req = $this->client + ->getClient() + ->delete('/api/3/eventTrackingEvent/' . $event_name); + + return 200 === $req->getStatusCode(); + } + + /** + * List all events + * @see https://developers.activecampaign.com/v3/reference#list-all-event-types + * + * @param array $query_params + * @return string + */ + public function listAllEvents(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('api/3/eventTrackingEvents', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** + * Enable/Disable event tracking + * @see https://developers.activecampaign.com/v3/reference#enable-disable-event-tracking + * + * @param bool $enabled + * @return string + */ + public function toggleEventTracking(bool $enabled) + { + $req = $this->client + ->getClient() + ->put('/api/3/eventTracking/', [ + 'json' => [ + 'eventTracking' => [ + 'enabled' => $enabled + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + /** + * @param string $event_name + * @param null $event_data + * @param null $email + * @return string + */ + public function trackEvent(string $event_name, $event_data = null, $email = null) + { + $form_params = [ + 'event' => $event_name + ]; + + if (!is_null($event_data)) { + $form_params['eventdata'] = $event_data; + } + + if (!is_null($email)) { + $form_params['visit'] = json_encode([ + 'email' => $email + ]); + } + + $form_params = array_merge( + $form_params, + $this->client->getEventTrackingClient()->getConfig('form_params') + ); + + $req = $this->client + ->getEventTrackingClient() + ->post('', [ + 'form_params' => $form_params + ]); + + return $req->getBody()->getContents(); + } + +} \ No newline at end of file diff --git a/src/Tracking/SiteTracking.php b/src/Tracking/SiteTracking.php new file mode 100644 index 0000000..f1f7fec --- /dev/null +++ b/src/Tracking/SiteTracking.php @@ -0,0 +1,134 @@ +client + ->getClient() + ->post('api/3/siteTrackingDomains', [ + 'json' => [ + 'siteTrackingDomain' => [ + 'name' => $domain_name + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + + /** + * Get site tracking code (javascript snippet) + * @see https://developers.activecampaign.com/reference#retrieve-site-tracking-code + * + * @param array $query_params + * @return string + */ + public function retrieveSiteTrackingCode(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('api/3/siteTracking/code', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + + /** + * Get site tracking status (enabled or disabled) + * @see https://developers.activecampaign.com/reference#retrieve-site-tracking-status + * + * @param array $query_params + * @return string + */ + public function retrieveStatus(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('api/3/siteTracking', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + + /** + * Enable or disable site tracking + * @see https://developers.activecampaign.com/reference#enable-disable-site-tracking + * + * @param boolean $enabled + * @return string + */ + public function setTrackingStatus($enabled = true) + { + $req = $this->client + ->getClient() + ->put('api/3/siteTracking', [ + 'json' => [ + 'siteTracking' => [ + 'enabled' => $enabled === true ? true : false + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + + /** + * Remove a domain from the site tracking whitelist + * @see https://developers.activecampaign.com/reference#remove-domain-from-whitelist + * + * @param string $domain_name + * @return string + */ + public function removeDomain($domain_name) + { + $req = $this->client + ->getClient() + ->delete('api/3/siteTrackingDomains/' . $domain_name); + + return 200 === $req->getStatusCode(); + } + + + /** + * List of all whitelisted site tracking domains + * @see https://developers.activecampaign.com/reference#list-all-whitelisted-domains + * + * @param array $query_params + * @return string + */ + public function listAllDomains(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('api/3/siteTrackingDomains', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + +} \ No newline at end of file diff --git a/src/contacts/Contacts.php b/src/contacts/Contacts.php index 169ffb8..fe7d32b 100644 --- a/src/contacts/Contacts.php +++ b/src/contacts/Contacts.php @@ -68,6 +68,19 @@ public function get(int $id) return $req->getBody()->getContents(); } + /** + * Get a contact by email (helper function) + * @see https://developers.activecampaign.com/reference#list-all-contacts + * + * @param int $id + * @return string + */ + public function getByEmail(string $email) + { + return $this->listAll(['email' => $email]); + } + + /** * Update list status for a contact * @see https://developers.activecampaign.com/reference#update-list-status-for-contact @@ -141,6 +154,29 @@ public function listAutomations(int $id) return $req->getBody()->getContents(); } + /** + * Add a contact to an automation + * @see https://developers.activecampaign.com/reference#create-new-contactautomation + * + * @param int $contact_id + * @param int $automation_id + * @return string + */ + public function triggerAutomation(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(); + } + /** * Add a tag to contact * @see https://developers.activecampaign.com/reference#create-contact-tag diff --git a/src/tracking/SiteTracking.php b/src/tracking/SiteTracking.php index 4343127..f1f7fec 100644 --- a/src/tracking/SiteTracking.php +++ b/src/tracking/SiteTracking.php @@ -12,9 +12,52 @@ class SiteTracking extends Resource { + /** + * Add a domain to the site tracking whitelist + * @see https://developers.activecampaign.com/reference#add-domain-to-whitelist + * + * @param string $domain_name + * @return string + */ + public function addDomain($domain_name) + { + $req = $this->client + ->getClient() + ->post('api/3/siteTrackingDomains', [ + 'json' => [ + 'siteTrackingDomain' => [ + 'name' => $domain_name + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + + /** + * Get site tracking code (javascript snippet) + * @see https://developers.activecampaign.com/reference#retrieve-site-tracking-code + * + * @param array $query_params + * @return string + */ + public function retrieveSiteTrackingCode(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('api/3/siteTracking/code', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + + /** * Get site tracking status (enabled or disabled) * @see https://developers.activecampaign.com/reference#retrieve-site-tracking-status + * * @param array $query_params * @return string */ @@ -29,4 +72,63 @@ public function retrieveStatus(array $query_params = []) return $req->getBody()->getContents(); } + + /** + * Enable or disable site tracking + * @see https://developers.activecampaign.com/reference#enable-disable-site-tracking + * + * @param boolean $enabled + * @return string + */ + public function setTrackingStatus($enabled = true) + { + $req = $this->client + ->getClient() + ->put('api/3/siteTracking', [ + 'json' => [ + 'siteTracking' => [ + 'enabled' => $enabled === true ? true : false + ] + ] + ]); + + return $req->getBody()->getContents(); + } + + + /** + * Remove a domain from the site tracking whitelist + * @see https://developers.activecampaign.com/reference#remove-domain-from-whitelist + * + * @param string $domain_name + * @return string + */ + public function removeDomain($domain_name) + { + $req = $this->client + ->getClient() + ->delete('api/3/siteTrackingDomains/' . $domain_name); + + return 200 === $req->getStatusCode(); + } + + + /** + * List of all whitelisted site tracking domains + * @see https://developers.activecampaign.com/reference#list-all-whitelisted-domains + * + * @param array $query_params + * @return string + */ + public function listAllDomains(array $query_params = []) + { + $req = $this->client + ->getClient() + ->get('api/3/siteTrackingDomains', [ + 'query' => $query_params + ]); + + return $req->getBody()->getContents(); + } + } \ No newline at end of file