PHP code example of cars24 / pipedrive

1. Go to this page and download the library: Download cars24/pipedrive library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

cars24 / pipedrive example snippets


use Benhawker\Pipedrive\Pipedrive;  

$pipedrive = new Pipedrive('0deceea867202fcf3889cd507ef93a91789f7e3a');  

//add user  
$person['name'] = 'John Smith';  

$person = $pipedrive->persons()->add($person);  

//add note to user  
$note['content']   = 'example note';  
$note['person_id'] = $person['data']['id'];  

$pipedrive->notes()->add($note);  

//add deal to user  
deal['title']      = 'example title';  
$deal['stage_id']  = 8;  
$deal['person_id'] = $person['data']['id'];  

$pipedrive->deals()->add($deal);  

//add activity  
$activity = array(  
                    'subject' => 'Example send brochure',  
                    'type' => 'send-brochure',  
                    'person_id' => 17686,  
                    'user_id' => 190870,  
                    'deal_id' => 88,  
                    'due_date' => date('Y-m-d')  
                    );  

$pipedrive->activities()->add($activity);