Hi There!

I am trying to use Guzzle to integrate with the IS API. I have done all the steps to get a correct access token, and am able to make a request. However there documentation is not clear on to how to actually send the data when trying to ‘write’.

Currently I am trying to create a basic contact. Documentation for this is here:!/Contact/createOrUpdateContactUsingPUT

The contact I am trying to test create looks like this:
$contact = [
‘email_addresses’ => [
‘email’=> ‘’,
‘field’=> ‘main email’,
‘given_name’=> ‘Firstname’,
‘family_name’=> ‘Familyname’,

I am trying to do a PUT, and have the body set to json_encode($contact), however I get a 400 error with message of: {“message”:“Input could not be converted to a valid request”}

I have tried a few different combinations of trying to send as form-encoded data, etc, but nothing is working correctly.

Can anyone offer the correct way to send this json data to the ‘PUT/POST’ endpoints to be able to create data in IS?

I DO NOT want to use the PHP SDK, as the documentation is lacking and I keep getting expired token exceptions, when I am refreshing my token each request, and using the new one. I should be able to write these myself very easily, but the error messages are not intuitive.

Thanks in advance for your help!

At the stage you’re at, I would normally use Postman. The reason for this is that it often is the case that using json_encode makes it a challenge to get it right. If you use postman and then just put the json directly into the body, work out the details until it’s successful, then use the code generator to create your method, then you’ll only have to use json_decode from the results (which will return everything as an object to you). Doing it the way you’re doing it has only created json issues for me so I’ve found postman to be a much simpler approach.

Thanks for the advice. I actually use Postman all the time for other things, and didn’t even think about it for this. The issue actually was that the JSON account object was not created correctly. I just wish the error message was a little more intuitive about the real issue. Anyways, once I fixed that issue, then I had other errors, but those errors were pretty clear and was able to fix those.

Thanks again for the advice. Will definitely be using Postman for other tests!

Yeah, I hear ya…it is VERY vague lol

One of the reasons I always build/test with postman first because it’s more obvious and I can then just grab the autogen code and create a method/function out of it.

Glad you got it worked out though! :wink: