Skip to content

Commit 9313e6d

Browse files
committed
improve README formatting
1 parent 5fec76c commit 9313e6d

File tree

1 file changed

+28
-45
lines changed

1 file changed

+28
-45
lines changed

README.md

Lines changed: 28 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
##Node JS SDK for Zoho CRM
1+
## Node JS SDK for Zoho CRM
22

3-
##Abstract
3+
## Abstract
44

55
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.
66

77
This SDK supports both single user as well as multi user authentication.
88

9-
##Registering a Zoho Client
9+
## Registering a Zoho Client
1010

1111
Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register your client app with Zoho. To register your app:
1212

@@ -22,9 +22,9 @@ Since Zoho CRM APIs are authenticated with OAuth2 standards, you should register
2222

2323
- Your Client app would have been created and displayed by now.
2424

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).
2626

27-
##Installation of Node CRM SDK
27+
## Installation of Node CRM SDK
2828

2929
Node JS SDK will be installed and a package named 'zcrmsdk' will be created in the installation directory.
3030

@@ -34,28 +34,23 @@ Once installed it can be used in the code as below,
3434

3535
>var ZCRMRestClient = require('zcrmsdk')
3636
37-
##API Usage
37+
## API Usage
3838

39-
##Configurations
39+
## Configurations
4040

4141
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.
4242

43-
44-
zcrmsdk will try reading file from **'resources/oauth_configuration.properties'**
45-
43+
zcrmsdk will try reading file from **'resources/oauth_configuration.properties'**
4644

4745
Please fill the values for the following keys alone.
4846
Based on your domain(EU,CN), please change the value of crm.iamurl. Default value set as US domain.
4947

50-
5148
```
52-
5349
[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=
5954
```
6055

6156
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:
6560

6661
```
6762
[crm]
68-
api.url=
69-
api.user_identifier=
70-
api.tokenmanagement=
63+
api.url=
64+
api.user_identifier=
65+
api.tokenmanagement=
7166
7267
[mysql]
7368
username=
74-
password=
75-
69+
password=
7670
```
7771
api.url is the URL used to call APIs. By default, the URL is www.zohoapis.com.
7872
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
8175
The above keys specified in configuration.properties file are all optional.
8276

8377
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
8579
2.Can be set via code using set setUserIdentifier.
8680

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 .
8882

8983

90-
##Token Storage Mechanism
84+
## Token Storage Mechanism
9185

9286
To use the default token storage provided by the SDK, the following are to be done:
9387

@@ -106,11 +100,10 @@ This module should contain the below methods,
106100
The expected response for this method : JSON array containing json response with expirytime, refreshtoken and accesstoken fields.
107101

108102

109-
##Generating self-authorized grant and refresh token
103+
## Generating self-authorized grant and refresh token
110104

111105
For self client apps, the self authorized grant token should be generated from the Zoho Developer Console (https://accounts.zoho.com/developerconsole)
112106

113-
114107
- Visit https://accounts.zoho.com/developerconsole
115108

116109
- Click Options → Self Client of the client for which you wish to authorize.
@@ -129,7 +122,7 @@ Each time server is restarted, this function has to be called and both the confi
129122
**All functions return promises in zcrm node sdk.**
130123

131124

132-
##Initialize
125+
## Initialize
133126

134127
Below snippet has to be called before starting the app
135128

@@ -141,24 +134,21 @@ ZCRMRestClient.initialize().then(function(){
141134
...
142135
143136
});
144-
145137
```
146138

147-
##Generating access and refresh token from granttoken
139+
## Generating access and refresh token from granttoken
148140

149141
```
150-
151142
ZCRMRestClient.generateAuthTokens(user_identifier,grant_token).then(function(auth_response){
152143
153144
console.log("access token :"+auth_response.access_token);
154145
console.log("refresh token :"+auth_response.refresh_token);
155146
console.log("expires in :"+auth_response.expires_in);
156147
157148
});
158-
159149
```
160150

161-
##Generating access token from refresh token
151+
## Generating access token from refresh token
162152

163153
This will be handled by sdk itself if the access and refresh token is generated by sdk.Developer need not call this explicitly.
164154

@@ -170,10 +160,9 @@ ZCRMRestClient.generateAuthTokenfromRefreshToken(user_identifier,refresh_token).
170160
console.log("expires in :"+auth_response.expires_in);
171161
172162
});
173-
174163
```
175164

176-
##Sample API Calls
165+
## Sample API Calls
177166

178167
```
179168
var input ={};
@@ -194,7 +183,7 @@ crmclient.API.MODULES.get(input).then(function(response){
194183
195184
var record = data[i];
196185
var name = record.Full_Name;
197-
186+
198187
result+="<br><span>"+name+"</span>";
199188
200189
}
@@ -206,7 +195,7 @@ crmclient.API.MODULES.get(input).then(function(response){
206195

207196

208197

209-
##Hierarchy
198+
## Hierarchy
210199
zcrmsdk
211200

212201
```
@@ -248,20 +237,14 @@ zcrmsdk
248237
executeFunctionsInPost
249238
```
250239

251-
252240
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.
253241

254242
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.
255243

256-
257-
258-
##Response Handling
244+
## Response Handling
259245
All API calls will give the actual API response given by Zoho APIs, except file download.
260246

261247
For file download, the response will contain an extra field filename.
262248

263-
##Error Handling:
249+
## Error Handling:
264250
All errors will be thrown explicitly and care should be taken in catching the same.
265-
266-
267-

0 commit comments

Comments
 (0)