How do you update a contact using the PHP REST SDK?

I’m looking through the PHP SDK code on Github and I cannot find any update method for the REST APi. Was this not added? I can see update in the REST API documentation but it’s not in the code for the repo.

Does anyone have some suggestions?

Should I create a PR on the repo?

Anybody?

There is a bit of magic in the SDK to handle updates.

Here is an example of updating a contact.

$infusionsoft->contacts()->mock(['id' => 1234, 'FIELDTOUPDATE' => 'SOME VALUE'])->save();

Wicked thanks. Do you know if contacts()->create() returns notes? In the documentation it looks like createOrUpdate response returns notes but from my test it didn’t

Also in notes, what character is newline? I have tried \r\n but it didn’t work.

I’m trying to append some text to the notes once I have called createOrUpdate but can’t find a simple solution. Or is there a way to append to notes when calling createOrUpdate?

Is it possible to call createOrUpdate then use the returned customer ID and post to this:
https://developer.infusionsoft.com/docs/rest/#!/Note/createNoteUsingPOST

The SDK doesn’t have the notes endpoint yet but I can add it within the next day or two.

1 Like

That would be awesome

@Richard_Sanderson I have added the Notes endpoint to the SDK. You’ll need to update to v1.4.4.

Hello @MichaelFairchild,

I am getting a 500 Error Code using your sample. I’ve also tested the PATCH endpoint for contact in the REST API Reference and also got error 500. Please see attached files. (Removed due to containing access token) . Here is my code snippet from my php backend:

image

1 Like

Hi @Ray_Villanueva, this appears to have been caused by a recent code change on our end and we are looking into a fix. Thanks for bringing it to our attention!

Hello @Nicholas_Trecina, thanks for the feedback. Is there an update to this one? This is now a major blocker in our system.

Thanks,
Ray

Hi @Ray_Villanueva, the fix will be deployed to all customers over the course of today and tomorrow and by Wednesday it will deployed to everyone.