Skip to content

Commit

Permalink
Revert "Fixed REST applying tags for contacts"
Browse files Browse the repository at this point in the history
  • Loading branch information
jgourley authored Mar 24, 2021
1 parent 94912a8 commit 09fdd2e
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/Infusionsoft/Api/Rest/TagService.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,20 @@ public function removeContacts($contactIds)
return $response;
}

/**
* @param array $contactIds
* @param int $tagId
*
* @return mixed
* @throws InfusionsoftException
*/
public function addContacts($contactIds, $tagId)
public function addContacts($contactIds)
{
if ( ! is_array($contactIds) ) {
if ( ! is_array($contactIds)) {
throw new InfusionsoftException('Must be an array of contact ids');
}
if ( count($contactIds) > 100 ) {
} elseif (count($contactIds) > 100) {
throw new InfusionsoftException('A maximum of 100 contact ids can be modified at once');
}
if ( !is_int($tagId) ) {
throw new InfusionsoftException('Tag id must be an integer.');
}

$contacts = new \stdClass();
$contacts->ids = $contactIds;
return $this->client->restfulRequest('post', $this->getFullUrl($this->id . '/' . $tagId . '/contacts'), $contacts);

$response = $this->client->restfulRequest('post', $this->getFullUrl($this->id . '/contacts'), $contacts);

return $response;
}

public function addCategory($name, $description)
Expand Down

0 comments on commit 09fdd2e

Please sign in to comment.