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
Copy file name to clipboardExpand all lines: README.md
+28-45Lines changed: 28 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
-
##Node JS SDK for Zoho CRM
1
+
##Node JS SDK for Zoho CRM
2
2
3
-
##Abstract
3
+
##Abstract
4
4
5
5
Node SDK is a wrapper for Zoho CRM APIs. Hence invoking a Zoho CRM API from your Node application is just a function call which provide the most appropriate response.
6
6
7
7
This SDK supports both single user as well as multi user authentication.
8
8
9
-
##Registering a Zoho Client
9
+
##Registering a Zoho Client
10
10
11
11
Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:
12
12
@@ -22,9 +22,9 @@ Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register
22
22
23
23
- Your Client app would have been created and displayed by now.
24
24
25
-
- The newly registered app's Client ID and Client Secret can be found by clicking Options → Edit.(Options is the three dot icon at the right corner).
25
+
- The newly registered app's Client ID and Client Secret can be found by clicking Options → Edit.(Options is the three dot icon at the right corner).
26
26
27
-
##Installation of Node CRM SDK
27
+
##Installation of Node CRM SDK
28
28
29
29
Node JS SDK will be installed and a package named 'zcrmsdk' will be created in the installation directory.
30
30
@@ -34,28 +34,23 @@ Once installed it can be used in the code as below,
34
34
35
35
>var ZCRMRestClient = require('zcrmsdk')
36
36
37
-
##API Usage
37
+
##API Usage
38
38
39
-
##Configurations
39
+
##Configurations
40
40
41
41
Your OAuth Client details should be given to the SDK as a property file. In the SDK, you need to configure a file named oauth_configuration.properties. Please place the respective values in that file. You can place it under resources/ package from where the SDK is used.
42
42
43
-
44
-
zcrmsdk will try reading file from **'resources/oauth_configuration.properties'**
45
-
43
+
zcrmsdk will try reading file from **'resources/oauth_configuration.properties'**
46
44
47
45
Please fill the values for the following keys alone.
48
46
Based on your domain(EU,CN), please change the value of crm.iamurl. Default value set as US domain.
49
47
50
-
51
48
```
52
-
53
49
[zoho]
54
-
crm.iamurl=
55
-
crm.clientid=
56
-
crm.clientsecret=
57
-
crm.redirecturl=
58
-
50
+
crm.iamurl=
51
+
crm.clientid=
52
+
crm.clientsecret=
53
+
crm.redirecturl=
59
54
```
60
55
61
56
crm.clientid, crm.clientsecret and crm.redirecturl are your OAuth client’s configurations that you get after registering your Zoho client.
@@ -65,14 +60,13 @@ In configuration.properties file:
65
60
66
61
```
67
62
[crm]
68
-
api.url=
69
-
api.user_identifier=
70
-
api.tokenmanagement=
63
+
api.url=
64
+
api.user_identifier=
65
+
api.tokenmanagement=
71
66
72
67
[mysql]
73
68
username=
74
-
password=
75
-
69
+
password=
76
70
```
77
71
api.url is the URL used to call APIs. By default, the URL is www.zohoapis.com.
78
72
api.user_identifier will be empty by default. For single user authentication, this key can be filled with the respective email id, so that all calls happens by using this user's authentication.
@@ -81,13 +75,13 @@ username and password can be given here if you already have one created for your
81
75
The above keys specified in configuration.properties file are all optional.
82
76
83
77
user_identifier can be set in two ways .
84
-
1.Mentioning it in api.user_identifier in configuration.properties file
78
+
1.Mentioning it in api.user_identifier in configuration.properties file
85
79
2.Can be set via code using set setUserIdentifier.
86
80
87
-
If user_identifier is not set via both the ways then default value 'zcrm_default_user' will be set by the sdk itself .
81
+
If user_identifier is not set via both the ways then default value 'zcrm_default_user' will be set by the sdk itself .
88
82
89
83
90
-
##Token Storage Mechanism
84
+
##Token Storage Mechanism
91
85
92
86
To use the default token storage provided by the SDK, the following are to be done:
93
87
@@ -106,11 +100,10 @@ This module should contain the below methods,
106
100
The expected response for this method : JSON array containing json response with expirytime, refreshtoken and accesstoken fields.
107
101
108
102
109
-
##Generating self-authorized grant and refresh token
103
+
##Generating self-authorized grant and refresh token
110
104
111
105
For self client apps, the self authorized grant token should be generated from the Zoho Developer Console (https://accounts.zoho.com/developerconsole)
As appearing in the hierarchy, zcrmsdk entity class has instance variables to fetch its own properties and to fetch data of its immediate child entities through an API call.
253
241
254
242
For example, to call an API to get module data, the request should be zcrmsdk.API.MODULES.{operation_type}. The operation types can be GET, POST, PUT, DELETE or CREATE.
255
243
256
-
257
-
258
-
##Response Handling
244
+
## Response Handling
259
245
All API calls will give the actual API response given by Zoho APIs, except file download.
260
246
261
247
For file download, the response will contain an extra field filename.
262
248
263
-
##Error Handling:
249
+
##Error Handling:
264
250
All errors will be thrown explicitly and care should be taken in catching the same.
0 commit comments