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:
https://developer.infusionsoft.com/docs/rest/#!/Contact/createOrUpdateContactUsingPUT
The contact I am trying to test create looks like this:
$contact = [
‘email_addresses’ => [
‘email’=> ‘test@test.com’,
‘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!