infusionsoft / infusionsoft-php

PHP client library for the Infusionsoft API.
https://developer.infusionsoft.com/
Other
129 stars 126 forks source link

Poor Sample Documentation #233

Open smurfiez opened 4 years ago

smurfiez commented 4 years ago

I've been looking through the samples and there isn't a lot to work on.

How do I

  1. Add a tag to a user
  2. Add a custom field

As far as I can tell, the SDK is harder to use than calling the REST API directly.

ajohnson6494 commented 4 years ago

Too apply a tag to a contact simply call

$contact_id = 123;
$tag_ids = [1,2,3];
Infusionsoft::contacts()->find($contact_id)->addTags($tag_ids);

As for creating a custom field, the php-sdk has not been updated for the rest enpoint to do this yet, however you can do it through the old xml-rpc by call:

Infusionsoft::data()->addCustomField($customFieldType, $displayName, $dataType, $headerID)