I am trying to create a code that will retrieve leads data from our customer management software. Here is my entire code, minus the encryption key, I have highlighted the specific part I am working on. I am new to PHP so any help I could get would be awesome, or if you need any other questions answered then let me know.
#!/usr/bin/env php
<?php
// Configuration:
$apiKey = 'AUTH KEY';
$username = 'AUTH USERNAME';
// End of configuration
require_once('../NutshellApi.php');
$api = new NutshellApi($username, $apiKey);
/**
* Example: Retrieving entities from the Nutshell API using find* and get* methods
*
* Relevant documentation:
* http://www.nutshell.com/api/retrieving-editing.html
* http://www.nutshell.com/api/finding-searching.html
*/
// Retrieve a contact
/**echo "getContact example\n------------------------------------------------\n";
$params = array( 'contactId' => 5259 );
$result = $api->call('getContact', $params);
var_dump($result);
// Find contacts attached to lead #1209
echo "\nfindContacts example\n------------------------------------------------\n";
$params = array(
'query' => array(
'leadId' => 2926,
),
);
$result = $api->findContacts($params);
var_dump($result);
echo "searchLeads example\n------------------------------------------------\n";
$params = searchLeads ($status = 0,
$limit = 40
)
findLeads ($query,
$orderBy = '2926',
$orderDirection = 'ASC',
$limit = 50,
$page = 1,
$stubResponses = true
);
$result = $api->findLeads($params);
var_dump($result);
**/
$params = array(
'findLeads' => array('Status' =>0),
);