I’m trying to write custom fields back to a contact using PHP’s GuzzleHttp library. Although I’m able to send GET requests, etc., I feel I’m doing something wrong with this patch request as it returns me a 400 error {"message":"Input could not be converted to a valid request"}
.
I’ll be very happy if someone can look at this code and suggest what’s wrong. By the way, I was able to send this PATCH request using command-line curl, so I think it’s something related to the usage of GuzzleHttp here.
$url = 'https://api.infusionsoft.com/crm/rest/v1/contacts/' . $order->contact->id . '?access_token=' . $infs_token;
$response = $client->request('PATCH', $url, array(
'json' => array(
"custom_fields" => array(
'content' => $infs_points,
'id' => env('INFS_POINTS_FIELD_ID')
)
)
));
Thanks in advance!