Creating a Lead (PHP / Guzzle)
I am attempting to create a new lead using the API with Guzzle for PHP. I am able to pull a list of my leads via the API but when I attempt to create one, I am getting 'Client error: `POST https://api.insightly.com/v3.1/Leads` resulted in a `404 Not Found` response'. I am assuming that the contents of the post (Body) is not correct but I am using an array with the key of 'fieldValues' and the value of an json encoded array of values from the api example.
Is the key of the body fieldValues?
here is a sample of my code:
$lead = [
'SALUTATION' => 'Mr',
'FIRST_NAME' => 'Steve',
'LAST_NAME' => 'Smith',
'TITLE' => 'Potential Customer',
'OWNER_USER_ID' => 12345678,
'LEAD_SOURCE_ID' => 234567,
'LEAD_STATUS_ID' => 456789,
'ADDRESS_STATE' => 'Michigan',
'ADDRESS_POSTCODE' => '48312',
'RESPONSIBLE_USER_ID' => 1234567,
'LEAD_DESCRIPTION' => 'website',
$results = $this->client->request('POST',
['fieldValues' => json_encode($lead)],[
'headers' => [
'Authorization' => 'Basic '.base64_encode('my cool
Anything glaring that I am doing wrong? Thanks!