-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
40 lines (33 loc) · 955 Bytes
/
example.php
File metadata and controls
40 lines (33 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* example tine-client-php usage
*
* execute with:
* $ php example.php
*
* @author Philipp Schüle <p.schuele@metaways.de>
* @copyright Copyright (c) 2026 Metaways Infosystems GmbH (https://www.metaways.de)
*/
require_once 'vendor/autoload.php';
$tineConnector = new TineClient();
// login, do stuff, logout
echo "login ... \n";
$tineConnector->login();
// example where we fetch some CRM leads ...
$method = 'Crm.searchLeads';
echo "$method ... \n";
$leads = $tineConnector->{$method}(filter: [], paging: ['start' => 0, 'limit' => 4]);
echo "Got " . count($leads['results']) . " leads\n";
// print_r($leads);
// now we add a lead
$method = 'Crm.saveLead';
echo "$method ... \n";
$result = $tineConnector->{$method}(recordData: [
'lead_name' => 'My special lead',
'leadstate_id' => 1,
'leadtype_id' => 1,
'leadsource_id' => 1,
]);
echo print_r($result, true);
echo "logout ... \n";
$tineConnector->logout();