Created
April 22, 2015 17:37
-
-
Save iaintshine/95aaca914b215a83dc9e to your computer and use it in GitHub Desktop.
Fetch first page of deals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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