@friggframework/api-module-zoho-crm 2.0.0-next.0 → 2.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +183 -197
- package/dist/api.d.ts +101 -0
- package/dist/api.js +521 -0
- package/dist/defaultConfig.json +13 -0
- package/dist/definition.d.ts +22 -0
- package/dist/definition.js +75 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +32 -0
- package/dist/types.d.ts +356 -0
- package/dist/types.js +2 -0
- package/package.json +21 -10
- package/.env.example +0 -4
- package/CHANGELOG.md +0 -50
- package/api.js +0 -169
- package/defaultConfig.json +0 -13
- package/definition.js +0 -51
- package/images/image-1.jpg +0 -0
- package/images/image-10.jpg +0 -0
- package/images/image-11.jpg +0 -0
- package/images/image-12.jpg +0 -0
- package/images/image-2.jpg +0 -0
- package/images/image-3.jpg +0 -0
- package/images/image-5.jpg +0 -0
- package/images/image-6.jpg +0 -0
- package/images/image-7.jpg +0 -0
- package/images/image-9.jpg +0 -0
- package/images/image.jpg +0 -0
- package/index.js +0 -9
- package/jest-setup.js +0 -3
- package/jest-teardown.js +0 -2
- package/jest.config.js +0 -22
- package/tests/api.test.js +0 -195
package/README.md
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
# Zoho CRM
|
|
1
|
+
# Zoho CRM API Module
|
|
2
2
|
|
|
3
|
-
This is the API Module for Zoho CRM that allows
|
|
3
|
+
This is the TypeScript API Module for Zoho CRM that allows [Frigg](https://friggframework.org) applications to interact with the Zoho CRM API v8.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Features:**
|
|
6
|
+
- TypeScript with full type definitions
|
|
7
|
+
- OAuth 2.0 authentication
|
|
8
|
+
- Support for Users, Roles, Profiles, Contacts, Leads, and Accounts resources
|
|
9
|
+
- Comprehensive error handling
|
|
10
|
+
- Vitest test suite
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
[Link to the Zoho CRM REST API Postman collection](https://www.postman.com/zohocrmdevelopers/workspace/zoho-crm-developers/collection/8522016-0a15778a-ccb1-4676-98b7-4cf1fe7fc940?ctx=documentation)
|
|
8
13
|
|
|
14
|
+
Read more on the [Frigg documentation site](https://docs.friggframework.org/api-modules/list/zoho-crm)
|
|
9
15
|
|
|
10
|
-
## Setup a Zoho CRM
|
|
16
|
+
## Setup a Zoho CRM Developer Account
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
To test this API module, you'll need to populate your local `.env` file with credentials (`ZOHO_CRM_CLIENT_ID` and `ZOHO_CRM_CLIENT_SECRET`).
|
|
13
19
|
|
|
14
|
-
To get
|
|
20
|
+
To get these credentials, sign up for a Zoho CRM developer account and [create a new API client](https://www.zoho.com/crm/developer/docs/api/v8/register-client.html).
|
|
15
21
|
|
|
16
|
-
If you've already done this, skip to the next section.
|
|
22
|
+
If you've already done this, skip to the next section.
|
|
17
23
|
|
|
18
24
|
1. Go to https://www.zoho.com/crm/developer/ and click `Sign Up For Free`
|
|
19
25
|

|
|
20
26
|
|
|
21
|
-
|
|
22
27
|
2. Once you're in, set up your example company. Check the `Load Sample Data` box.
|
|
23
28
|

|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
3. Go to your account's API Console at https://api-console.zoho.com/.
|
|
30
|
+
3. Go to your account's API Console at https://api-console.zoho.com/
|
|
27
31
|
|
|
28
32
|
* You may be asked to verify your email address before accessing your API Console
|
|
29
33
|

|
|
@@ -31,239 +35,221 @@ If you've already done this, skip to the next section.
|
|
|
31
35
|
* You'll receive an email with a verification link
|
|
32
36
|

|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
4. From your API Console, you are able to create client for your account. For our purposes, select `Server-based Applications`.
|
|
38
|
+
4. From your API Console, create a client for your account. Select `Server-based Applications`.
|
|
36
39
|

|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
5. When filling in the details for your new client, make sure to use `http://localhost:3000/redirect/zoho-crm` in the `Authorized Redirect URIs` field.
|
|
41
|
+
5. When filling in the details for your new client, use `http://localhost:3000/redirect/zoho-crm` in the `Authorized Redirect URIs` field.
|
|
40
42
|

|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
6. After creating the client, you will be sent to the `Client Secret` tab where you can grab your Client ID and Client Secret.
|
|
44
|
+
6. After creating the client, you'll be sent to the `Client Secret` tab where you can grab your Client ID and Client Secret.
|
|
44
45
|

|
|
45
46
|
|
|
47
|
+
## Set Up Your Local `.env` File
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
1. Make a copy of `.env.example` and name it `.env`.
|
|
50
|
-
|
|
49
|
+
1. Make a copy of `.env.example` and name it `.env`
|
|
51
50
|
|
|
52
|
-
2.
|
|
51
|
+
2. Paste your Client ID and Client Secret from the Zoho CRM API Console into your `.env` file:
|
|
53
52
|
```shell
|
|
54
53
|
ZOHO_CRM_CLIENT_ID=your_client_id
|
|
55
54
|
ZOHO_CRM_CLIENT_SECRET=your_client_secret
|
|
56
|
-
ZOHO_CRM_SCOPE=ZohoCRM.users.ALL,ZohoCRM.org.ALL,ZohoCRM.settings.roles.ALL,ZohoCRM.settings.profiles.ALL
|
|
55
|
+
ZOHO_CRM_SCOPE=ZohoCRM.users.ALL,ZohoCRM.org.ALL,ZohoCRM.settings.roles.ALL,ZohoCRM.settings.profiles.ALL,ZohoCRM.modules.contacts.ALL,ZohoCRM.modules.leads.ALL,ZohoCRM.modules.accounts.ALL
|
|
57
56
|
REDIRECT_URI=http://localhost:3000/redirect
|
|
58
57
|
```
|
|
59
58
|
|
|
59
|
+
## Available API Resources
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
### Users
|
|
62
|
+
- `listUsers(queryParams)` - List all users with optional filters
|
|
63
|
+
- `getUser(userId)` - Get a specific user by ID
|
|
64
|
+
- `createUser(body)` - Create a new user
|
|
65
|
+
- `updateUser(userId, body)` - Update an existing user
|
|
66
|
+
- `deleteUser(userId)` - Delete a user
|
|
62
67
|
|
|
63
|
-
|
|
68
|
+
### Roles
|
|
69
|
+
- `listRoles()` - List all roles
|
|
70
|
+
- `getRole(roleId)` - Get a specific role by ID
|
|
71
|
+
- `createRole(body)` - Create a new role
|
|
72
|
+
- `updateRole(roleId, body)` - Update an existing role
|
|
73
|
+
- `deleteRole(roleId, queryParams)` - Delete a role
|
|
64
74
|
|
|
65
|
-
|
|
75
|
+
### Profiles
|
|
76
|
+
- `listProfiles()` - List all profiles
|
|
66
77
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const {Api} = require('./api.js');
|
|
78
|
+
### Contacts
|
|
79
|
+
- `listContacts(queryParams)` - List contacts with optional filters (fields, per_page, page, sort_by, sort_order)
|
|
80
|
+
- `getContact(contactId)` - Get a specific contact by ID
|
|
81
|
+
- `searchContacts(searchParams)` - Search contacts by email, phone, criteria, or word
|
|
72
82
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
redirect_uri: `${process.env.REDIRECT_URI}/zoho-crm`,
|
|
78
|
-
});
|
|
83
|
+
### Leads
|
|
84
|
+
- `listLeads(queryParams)` - List leads with optional filters (fields, per_page, page, sort_by, sort_order)
|
|
85
|
+
- `getLead(leadId)` - Get a specific lead by ID
|
|
86
|
+
- `searchLeads(searchParams)` - Search leads by email, phone, criteria, or word
|
|
79
87
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
delete response.base;
|
|
88
|
+
### Accounts
|
|
89
|
+
- `listAccounts(queryParams)` - List accounts with optional filters (fields, per_page, page, sort_by, sort_order)
|
|
90
|
+
- `getAccount(accountId)` - Get a specific account by ID
|
|
91
|
+
- `searchAccounts(searchParams)` - Search accounts by phone, criteria, or word
|
|
85
92
|
|
|
86
|
-
|
|
93
|
+
## Using the API Module from the Terminal
|
|
87
94
|
|
|
88
|
-
|
|
95
|
+
With your `.env` in place, you can test the API from a Node terminal.
|
|
89
96
|
|
|
97
|
+
1. Build the module first:
|
|
98
|
+
```bash
|
|
99
|
+
npm run build
|
|
90
100
|
```
|
|
91
101
|
|
|
92
|
-
|
|
93
|
-

|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
4. After authorizing, the tokens are returned to your terminal where they are used to create an authenticated instance of the Zoho CRM API module in the `api` variable. From here you can call any of the existing API resources defined in the module.
|
|
97
|
-
* List existing Users:
|
|
98
|
-
```js
|
|
99
|
-
> await api.listUsers()
|
|
100
|
-
{
|
|
101
|
-
users: [
|
|
102
|
-
{
|
|
103
|
-
country: 'HN',
|
|
104
|
-
name_format__s: 'Salutation,First Name,Last Name',
|
|
105
|
-
language: 'en_US',
|
|
106
|
-
microsoft: false,
|
|
107
|
-
'$shift_effective_from': null,
|
|
108
|
-
id: '6238474000000461001',
|
|
109
|
-
state: 'Francisco Morazan',
|
|
110
|
-
fax: null,
|
|
111
|
-
country_locale: 'en_US',
|
|
112
|
-
sandboxDeveloper: false,
|
|
113
|
-
zip: null,
|
|
114
|
-
decimal_separator: 'Period',
|
|
115
|
-
created_time: '2024-04-20T10:35:36-06:00',
|
|
116
|
-
time_format: 'hh:mm a',
|
|
117
|
-
offset: -21600000,
|
|
118
|
-
profile: [Object],
|
|
119
|
-
created_by: [Object],
|
|
120
|
-
zuid: '851289894',
|
|
121
|
-
full_name: 'Armando Alvarado',
|
|
122
|
-
phone: '32415425',
|
|
123
|
-
dob: null,
|
|
124
|
-
sort_order_preference__s: 'First Name,Last Name',
|
|
125
|
-
status: 'active',
|
|
126
|
-
role: [Object],
|
|
127
|
-
customize_info: [Object],
|
|
128
|
-
city: null,
|
|
129
|
-
signature: null,
|
|
130
|
-
locale: 'en_US',
|
|
131
|
-
personal_account: false,
|
|
132
|
-
Source__s: null,
|
|
133
|
-
Isonline: false,
|
|
134
|
-
default_tab_group: '0',
|
|
135
|
-
Modified_By: [Object],
|
|
136
|
-
street: null,
|
|
137
|
-
'$current_shift': null,
|
|
138
|
-
alias: null,
|
|
139
|
-
theme: [Object],
|
|
140
|
-
first_name: 'Armando Alvarado',
|
|
141
|
-
email: 'aaj2006@hotmail.com',
|
|
142
|
-
status_reason__s: null,
|
|
143
|
-
website: null,
|
|
144
|
-
Modified_Time: '2024-04-20T10:37:55-06:00',
|
|
145
|
-
'$next_shift': null,
|
|
146
|
-
mobile: null,
|
|
147
|
-
last_name: null,
|
|
148
|
-
time_zone: 'America/Tegucigalpa',
|
|
149
|
-
number_separator: 'Comma',
|
|
150
|
-
confirm: true,
|
|
151
|
-
date_format: 'MM-dd-yyyy',
|
|
152
|
-
category: 'regular_user'
|
|
153
|
-
}
|
|
154
|
-
]
|
|
155
|
-
}
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
* List existing Roles:
|
|
159
|
-
```js
|
|
160
|
-
> await api.listRoles()
|
|
161
|
-
{
|
|
162
|
-
roles: [
|
|
163
|
-
{
|
|
164
|
-
display_label: 'CEO',
|
|
165
|
-
created_by__s: null,
|
|
166
|
-
modified_by__s: null,
|
|
167
|
-
forecast_manager: null,
|
|
168
|
-
share_with_peers: true,
|
|
169
|
-
modified_time__s: null,
|
|
170
|
-
name: 'CEO',
|
|
171
|
-
description: 'Users with this role have access to the data owned by all other users.',
|
|
172
|
-
reporting_to: null,
|
|
173
|
-
id: '6238474000000026005',
|
|
174
|
-
created_time__s: null
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
display_label: 'Manager',
|
|
178
|
-
created_by__s: null,
|
|
179
|
-
modified_by__s: null,
|
|
180
|
-
forecast_manager: null,
|
|
181
|
-
share_with_peers: false,
|
|
182
|
-
modified_time__s: null,
|
|
183
|
-
name: 'Manager',
|
|
184
|
-
description: 'Users belonging to this role cannot see data for admin users.',
|
|
185
|
-
reporting_to: [Object],
|
|
186
|
-
id: '6238474000000026008',
|
|
187
|
-
created_time__s: null
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
```
|
|
102
|
+
2. Start a `node` terminal in `packages/v1-ready/zoho-crm`
|
|
192
103
|
|
|
193
|
-
|
|
194
|
-
|
|
104
|
+
3. Paste the following code:
|
|
105
|
+
```js
|
|
106
|
+
require('dotenv').config();
|
|
107
|
+
const {Authenticator} = require('@friggframework/test');
|
|
108
|
+
const {Api} = require('./dist/api.js');
|
|
109
|
+
|
|
110
|
+
api = new Api({
|
|
111
|
+
client_id: process.env.ZOHO_CRM_CLIENT_ID,
|
|
112
|
+
client_secret: process.env.ZOHO_CRM_CLIENT_SECRET,
|
|
113
|
+
scope: process.env.ZOHO_CRM_SCOPE,
|
|
114
|
+
redirect_uri: `${process.env.REDIRECT_URI}/zoho-crm`,
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const url = api.getAuthUri();
|
|
118
|
+
const response = await Authenticator.oauth2(url);
|
|
119
|
+
const baseArr = response.base.split('/');
|
|
120
|
+
response.entityType = baseArr[baseArr.length - 1];
|
|
121
|
+
delete response.base;
|
|
122
|
+
|
|
123
|
+
await api.getTokenFromCode(response.data.code);
|
|
124
|
+
|
|
125
|
+
console.log('api ready!');
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
4. Your browser will open and send you to Zoho CRM to authorize the client. You may need to log in first.
|
|
129
|
+

|
|
130
|
+
|
|
131
|
+
5. After authorizing, the tokens are returned to your terminal and used to create an authenticated API instance. You can now call any API method:
|
|
132
|
+
|
|
133
|
+
**List Users:**
|
|
134
|
+
```js
|
|
135
|
+
await api.listUsers()
|
|
136
|
+
```
|
|
195
137
|
|
|
196
|
-
|
|
138
|
+
**List Roles:**
|
|
139
|
+
```js
|
|
140
|
+
await api.listRoles()
|
|
141
|
+
```
|
|
197
142
|
|
|
198
|
-
|
|
143
|
+
**List Contacts:**
|
|
199
144
|
```js
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
145
|
+
await api.listContacts({ per_page: 10, fields: 'First_Name,Last_Name,Email' })
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Get Contact by ID:**
|
|
149
|
+
```js
|
|
150
|
+
await api.getContact('contact_id_here')
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Search Contacts:**
|
|
154
|
+
```js
|
|
155
|
+
await api.searchContacts({ email: 'example@email.com' })
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Using this API Module in a Frigg Application
|
|
159
|
+
|
|
160
|
+
1. Install the module:
|
|
161
|
+
```bash
|
|
162
|
+
npm install @friggframework/api-module-zoho-crm
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
2. Populate your `.env` file with `ZOHO_CRM_CLIENT_ID`, `ZOHO_CRM_CLIENT_SECRET`, and `ZOHO_CRM_SCOPE`
|
|
166
|
+
|
|
167
|
+
3. Create a Frigg integration class:
|
|
168
|
+
```typescript
|
|
169
|
+
import { IntegrationBase } from '@friggframework/core';
|
|
170
|
+
import { Definition as ZohoCRMModule } from '@friggframework/api-module-zoho-crm';
|
|
203
171
|
|
|
204
172
|
class ZohoCRMIntegration extends IntegrationBase {
|
|
205
|
-
static
|
|
206
|
-
name: '
|
|
173
|
+
static Definition = {
|
|
174
|
+
name: 'zohoCrm',
|
|
207
175
|
version: '1.0.0',
|
|
208
|
-
|
|
209
|
-
|
|
176
|
+
display: {
|
|
177
|
+
name: 'Zoho CRM',
|
|
178
|
+
description: 'Zoho CRM integration for managing contacts, users, and roles',
|
|
179
|
+
category: 'CRM',
|
|
180
|
+
},
|
|
181
|
+
modules: {
|
|
182
|
+
'zohoCrm': ZohoCRMModule
|
|
183
|
+
}
|
|
210
184
|
};
|
|
211
185
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
description: 'CRM Stuff',
|
|
219
|
-
category: 'CRM',
|
|
220
|
-
detailsUrl: 'https://www.zoho.com/crm/',
|
|
221
|
-
icon: 'https://static.zohocdn.com/crm/images/favicon_cbfca4856ba4bfb37be615b152f95251_.ico',
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
static modules = {
|
|
226
|
-
'zoho-crm': ZohoCRMModule
|
|
186
|
+
constructor() {
|
|
187
|
+
super();
|
|
188
|
+
this.events = {
|
|
189
|
+
LIST_CONTACTS: { handler: this.listContacts },
|
|
190
|
+
GET_CONTACT: { handler: this.getContact },
|
|
191
|
+
};
|
|
227
192
|
}
|
|
228
193
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*/
|
|
232
|
-
async receiveNotification(notifier, event, object = null) {
|
|
233
|
-
if (event === 'GET_SOMETHING') {
|
|
234
|
-
return this.target.api.getProjects();
|
|
235
|
-
}
|
|
194
|
+
async listContacts(params) {
|
|
195
|
+
return this.modules['zoho-crm'].api.listContacts(params);
|
|
236
196
|
}
|
|
237
197
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
*/
|
|
241
|
-
async getSampleData() {
|
|
242
|
-
const response = await this.target.api.listRoles();
|
|
243
|
-
const data = response.roles.map(role => ({
|
|
244
|
-
'Id': role.id,
|
|
245
|
-
'Name': role.name,
|
|
246
|
-
'Description': role.description,
|
|
247
|
-
}));
|
|
248
|
-
return {data};
|
|
198
|
+
async getContact(params) {
|
|
199
|
+
return this.modules['zoho-crm'].api.getContact(params.contactId);
|
|
249
200
|
}
|
|
250
201
|
}
|
|
251
|
-
|
|
252
|
-
|
|
202
|
+
|
|
203
|
+
export default ZohoCRMIntegration;
|
|
253
204
|
```
|
|
254
205
|
|
|
255
|
-
4.
|
|
206
|
+
4. Register your integration in your Frigg app definition's `integrations` array
|
|
256
207
|

|
|
257
208
|
|
|
258
|
-
5. Zoho CRM
|
|
209
|
+
5. Zoho CRM will appear in your list of available integrations
|
|
259
210
|

|
|
260
211
|
|
|
212
|
+
## Development
|
|
213
|
+
|
|
214
|
+
### Build
|
|
215
|
+
```bash
|
|
216
|
+
npm run build
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Run Tests
|
|
220
|
+
The API tests verify CRUD operations work as expected. You'll need valid credentials in your `.env` file.
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npm test
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
When running tests, a browser tab will open requesting authorization. After authorizing, the tests will run.
|
|
227
|
+
|
|
228
|
+
**Note:** There is a 240-second timeout for authorization requests.
|
|
229
|
+
|
|
230
|
+
### Watch Mode
|
|
231
|
+
```bash
|
|
232
|
+
npm run test:watch
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## TypeScript Support
|
|
236
|
+
|
|
237
|
+
This module is written in TypeScript and includes full type definitions. Import types as needed:
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
import { Api, ZohoConfig, ContactsResponse, QueryParams } from '@friggframework/api-module-zoho-crm';
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## API Version
|
|
244
|
+
|
|
245
|
+
This module uses **Zoho CRM API v8**. The base URL is `https://www.zohoapis.com/crm/v8`.
|
|
261
246
|
|
|
262
|
-
##
|
|
247
|
+
## Dependencies
|
|
263
248
|
|
|
264
|
-
|
|
249
|
+
- `@friggframework/core` ^2.0.0-next.16
|
|
250
|
+
- `dotenv` ^16.0.0
|
|
251
|
+
- `form-data` (for OAuth token exchange)
|
|
265
252
|
|
|
266
|
-
|
|
267
|
-

|
|
253
|
+
## License
|
|
268
254
|
|
|
269
|
-
|
|
255
|
+
MIT
|
package/dist/api.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { OAuth2Requester } from '@friggframework/core';
|
|
2
|
+
import { ZohoConfig, QueryParams, SearchParams, UsersResponse, RolesResponse, ProfilesResponse, ContactsResponse, ContactResponse, LeadsResponse, LeadResponse, AccountsResponse, AccountResponse, TokenResponse, CreateNoteData, NotesResponse, NoteListResponse, NotificationWatchConfig, NotificationResponse, NotificationDetailsResponse } from './types';
|
|
3
|
+
export declare class Api extends OAuth2Requester {
|
|
4
|
+
URLs: Record<string, string | ((id: string) => string)>;
|
|
5
|
+
private static readonly CONTACTS_DEFAULT_FIELDS;
|
|
6
|
+
private static readonly LEADS_DEFAULT_FIELDS;
|
|
7
|
+
private static readonly ACCOUNTS_DEFAULT_FIELDS;
|
|
8
|
+
constructor(params: ZohoConfig);
|
|
9
|
+
getAuthUri(): string;
|
|
10
|
+
getTokenFromCode(code: string): Promise<TokenResponse>;
|
|
11
|
+
_delete(options: any): Promise<any>;
|
|
12
|
+
/**
|
|
13
|
+
* Build URL for notes endpoints with proper encoding
|
|
14
|
+
* @param module - Module API name (e.g., 'Contacts', 'Leads')
|
|
15
|
+
* @param recordId - Record ID
|
|
16
|
+
* @param noteId - Optional note ID for specific note operations
|
|
17
|
+
* @returns Encoded URL path for notes endpoint
|
|
18
|
+
*/
|
|
19
|
+
private buildNotesUrl;
|
|
20
|
+
listUsers(queryParams?: QueryParams): Promise<UsersResponse>;
|
|
21
|
+
getUser(userId: string): Promise<UsersResponse>;
|
|
22
|
+
createUser(body?: any): Promise<any>;
|
|
23
|
+
updateUser(userId: string, body?: any): Promise<any>;
|
|
24
|
+
deleteUser(userId: string): Promise<any>;
|
|
25
|
+
listRoles(): Promise<RolesResponse>;
|
|
26
|
+
getRole(roleId: string): Promise<RolesResponse>;
|
|
27
|
+
createRole(body?: any): Promise<any>;
|
|
28
|
+
updateRole(roleId: string, body?: any): Promise<any>;
|
|
29
|
+
deleteRole(roleId: string, queryParams?: any): Promise<any>;
|
|
30
|
+
listProfiles(): Promise<ProfilesResponse>;
|
|
31
|
+
listContacts(queryParams?: QueryParams): Promise<ContactsResponse>;
|
|
32
|
+
getContact(contactId: string): Promise<ContactResponse>;
|
|
33
|
+
searchContacts(searchParams?: SearchParams): Promise<ContactsResponse>;
|
|
34
|
+
listLeads(queryParams?: QueryParams): Promise<LeadsResponse>;
|
|
35
|
+
getLead(leadId: string): Promise<LeadResponse>;
|
|
36
|
+
searchLeads(searchParams?: SearchParams): Promise<LeadsResponse>;
|
|
37
|
+
listAccounts(queryParams?: QueryParams): Promise<AccountsResponse>;
|
|
38
|
+
getAccount(accountId: string): Promise<AccountResponse>;
|
|
39
|
+
searchAccounts(searchParams?: SearchParams): Promise<AccountsResponse>;
|
|
40
|
+
/**
|
|
41
|
+
* List all notes for a specific record
|
|
42
|
+
* @param module - Module API name (Contacts, Leads, Accounts, etc.)
|
|
43
|
+
* @param recordId - Record ID to get notes for
|
|
44
|
+
* @param queryParams - Optional query parameters (per_page, page, etc.)
|
|
45
|
+
* @returns Promise<NoteListResponse> Notes list response
|
|
46
|
+
*/
|
|
47
|
+
listNotes(module: string, recordId: string, queryParams?: QueryParams): Promise<NoteListResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Get a specific note by ID
|
|
50
|
+
* @param module - Module API name (Contacts, Leads, Accounts, etc.)
|
|
51
|
+
* @param recordId - Record ID the note is attached to
|
|
52
|
+
* @param noteId - Note ID to retrieve
|
|
53
|
+
* @returns Promise<NotesResponse> Note details
|
|
54
|
+
*/
|
|
55
|
+
getNote(module: string, recordId: string, noteId: string): Promise<NotesResponse>;
|
|
56
|
+
/**
|
|
57
|
+
* Create a note for a specific record
|
|
58
|
+
* @param module - Module API name (Contacts, Leads, Accounts, etc.)
|
|
59
|
+
* @param recordId - Record ID to attach note to
|
|
60
|
+
* @param noteData - Note data with Note_Content (required) and optional Note_Title
|
|
61
|
+
* @returns Promise<NotesResponse> Created note response
|
|
62
|
+
*/
|
|
63
|
+
createNote(module: string, recordId: string, noteData: CreateNoteData): Promise<NotesResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Update an existing note
|
|
66
|
+
* @param module - Module API name (Contacts, Leads, Accounts, etc.)
|
|
67
|
+
* @param recordId - Record ID the note is attached to
|
|
68
|
+
* @param noteId - Note ID to update
|
|
69
|
+
* @param noteData - Updated note data. At least one of Note_Content or Note_Title must be provided.
|
|
70
|
+
* @returns Promise<NotesResponse> Updated note response
|
|
71
|
+
*/
|
|
72
|
+
updateNote(module: string, recordId: string, noteId: string, noteData: Partial<CreateNoteData>): Promise<NotesResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Delete a note
|
|
75
|
+
* @param module - Module API name (Contacts, Leads, Accounts, etc.)
|
|
76
|
+
* @param recordId - Record ID the note is attached to
|
|
77
|
+
* @param noteId - Note ID to delete
|
|
78
|
+
* @returns Promise<NotesResponse> Deletion response
|
|
79
|
+
*/
|
|
80
|
+
deleteNote(module: string, recordId: string, noteId: string): Promise<NotesResponse>;
|
|
81
|
+
/**
|
|
82
|
+
* Enable notification channel to receive real-time events
|
|
83
|
+
* @param body - Notification configuration with watch items
|
|
84
|
+
* @returns Promise<NotificationResponse> Response with channel details
|
|
85
|
+
* @see https://www.zoho.com/crm/developer/docs/api/v8/notifications/enable.html
|
|
86
|
+
*/
|
|
87
|
+
enableNotification(body: NotificationWatchConfig): Promise<NotificationResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* Disable notification channels
|
|
90
|
+
* @param channelIds - Array of channel IDs to disable
|
|
91
|
+
* @returns Promise<NotificationResponse> Response confirming deletion
|
|
92
|
+
* @see https://www.zoho.com/crm/developer/docs/api/v8/notifications/disable.html
|
|
93
|
+
*/
|
|
94
|
+
disableNotification(channelIds: Array<string | number>): Promise<NotificationResponse>;
|
|
95
|
+
/**
|
|
96
|
+
* Get details of all active notification channels
|
|
97
|
+
* @returns Promise<NotificationDetailsResponse> Details of all active channels
|
|
98
|
+
* @see https://www.zoho.com/crm/developer/docs/api/v8/notifications/get-details.html
|
|
99
|
+
*/
|
|
100
|
+
getNotificationDetails(): Promise<NotificationDetailsResponse>;
|
|
101
|
+
}
|