A colleague was having trouble getting Infusionsoft Contact Notes using the NovakSolutions PHP SDK. He’s one hell of a good developer so I thought if he’s having trouble understanding the SDK and getting the contact notes, there’s also a lot of developers out there who would be having the same issues! Hence, this post. 🙂
Of course, like what any good Geekysaur would do, we experiment! This assumes that you already know, have been using, or at least installed NovakSolutions’ IFS PHP SDK. After a bit of experimentation, we found out that you need to do the following:
// We know how to get the contact record so let's do that.
$contacts = $IFS->query( new \Infusionsoft_Contact(), array( 'Email' => 'firstname.lastname@example.org' ) );
// Remember, the result set for contacts is an array! Now, let's search for the notes!
// All we have to do is use the same query format as above, but search on the
// ContactAction object.
$notes = $IFS->query( new \Infusionsoft_ContactAction(), array( 'ContactId' => $contacts->Id ) );
That’s it! Confusing at first but easy enough right!
How did you go? Did this help you? Do you have a better or cleaner way of doing this? Hit us up in the comments section!