Skip to content

Instantly share code, notes, and snippets.

@iaintshine
Created April 22, 2015 17:37
Show Gist options
  • Save iaintshine/95aaca914b215a83dc9e to your computer and use it in GitHub Desktop.
Save iaintshine/95aaca914b215a83dc9e to your computer and use it in GitHub Desktop.
Fetch first page of deals
<?php
// create a new intsance of BaseCRM php client
$client = new \BaseCRM\Client(['accessToken' => getenv('BASECRM_ACCESS_TOKEN')]);
// fetch first 100 deals
$deals = $client->deals->all(['page' => 1, 'per_page' => 100]);
// write deals to csv
$csv = fopen("/tmp/deals.csv", "w");
foreach($deals as $deal)
{
fputcsv($csv, $result);
}
// clean up
fclose($csv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment