You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 6, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+70-6Lines changed: 70 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,16 @@ You can enable logging by adding the following line after instantiating the clie
26
26
```php
27
27
$client->setLogger($myPsrLogger);
28
28
```
29
-
30
29
The logger should implement the PSR `LoggerInterface`. If the transport being used implements `LoggerAwareInterface`, this call will chaing to set the logger for the transport as well. The build in transport supports this.
31
30
31
+
### Choosing a different Zoho realm
32
+
33
+
ZohoCRMClient will by default connect to the API at `crm.zoho.com`. If you wish to connect to a different one, you can supply the TLD as the third parameter to the constructor. For example, customer on the EU realm should instantiate the client like this:
34
+
35
+
```php
36
+
$client = new ZohoCRMClient('Leads', 'yourAuthKey', 'eu');
37
+
```
38
+
32
39
### Using custom transport
33
40
34
41
If we wish, you can supply a custom transport class to ZohoCRMClient, as shown here:
@@ -52,11 +59,68 @@ $client = new ZohoCRMClient('Leads', $transport);
52
59
53
60
## Implemented Calls
54
61
At the moment only the following calls are supported
Optionally, you can add `onDuplicateUpdate()` or `onDuplicateError()` to the chain, before `request()`, to instruct Zoho to either update or fail on duplicated records.
91
+
Duplicate checking depends on the module being targeted, see the list in the [Zoho documentation](https://www.zoho.eu/crm/help/api/insertrecords.html#Duplicate_Check_Fields).
92
+
93
+
The `$records` array will contain an entry for each record you have tried to create, which on success will contain the ID of the new (or updated) record.
94
+
95
+
### updateRecords()
96
+
97
+
```php
98
+
use Christiaan\ZohoCRMClient\ZohoCRMClient;
99
+
100
+
$client = new ZohoCRMClient('Contacts', 'yourAuthKey');
101
+
102
+
$records = $client
103
+
->updateRecords()
104
+
->addRecord([
105
+
'Id' => '(ID returned from insert, search, ...)'
106
+
'Last Name' => 'Smith'
107
+
])
108
+
->request();
109
+
```
110
+
111
+
Specifying the ID per record is necessary when updating multiple records. Alternatively, you may call `id()` to set the ID if you are only updating a single record. Setting the ID per record works in either case.
112
+
113
+
### searchResults()
114
+
115
+
```php
116
+
use Christiaan\ZohoCRMClient\ZohoCRMClient;
117
+
118
+
$client = new ZohoCRMClient('Contacts', 'yourAuthKey');
0 commit comments