npm install zohoNode.js Zoho helper library for integrating Zoho Creator, CRM, Invoice and Support.




!Dependencies
``bash`
$ npm install zoho
- Zoho Creator
- Zoho CRM
- Zoho Invoice
- Zoho Support
#### Zoho
Initialize zoho
`js`
var Zoho = require('zoho');
#### Zoho#CRM(object)
Initialize CRM with an object authtoken
`js`
var crm = new Zoho.CRM({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
##### getRecords(:
`js
crm.getRecords('leads', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
`
#### Zoho#Invoice(object)
Initialize Invoice with an object authtoken
`js`
var invoice = new Zoho.Invoice({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
##### getRecords(:
`js
invoice.getRecords('contacts', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
`
#### Zoho#Support(object)
Initialize Support with an object authtoken
`js`
var support = new Zoho.Support({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
##### getRecords(:
`js
support.getRecords('contacts', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
`
#### Zoho#Creator(object)
Initialize Creator with an object authtoken
`js`
var creator = new Zoho.Creator({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
##### setCookie(
Set a cookie for "unofficial" API calls that require direct HTTP schemes.
`js`
creator.setCookie('somecookie');
##### viewRecordsInView(:
`js
creator.viewRecordsInView('sample','Employee_View', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
`
##### addRecords(
Add records.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-add-records.html
`js
`
##### editRecords(
Edit records.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-edit-records.html
`js
`
##### deleteRecords(
Delete records.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-delete-records.html
`js
`
##### viewRecordsInView(
Get records in view.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-view-records-in-view.html
`js
`
##### listFormFields(
List form fields.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-list-form-fields.html
`js
`
##### downloadImage(
Progmatically downloads a single image from Zoho Creator. Zoho doesn't officially provide support for downloading images or assets. However, this function will interact directly with the download endpoint. This requires a valid cookie to be set prior to requests.
`js
creator.setCookie('somecookie');
creator.downloadImage('/DownloadFile.do', {
filepath: '/somefilename.JPG',
sharedBy: '',
appLinkName: '',
viewLinkName: '',
recLinkID: '',
fieldLinkName: 'Image',
zcDownloadType: 'image'
}, function (err, data) {
if (err) { return res.send(err); }
res.send(new Buffer(data));
});
`
* Zoho Creator API
* Zoho CRM API
* Zoho Invoice API
* Zoho Support API Guide
##Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style.
Add unit tests for any new or changed functionality. Lint and test your code.
In order to colaborate to this project, create a .testrc file with the contents below to run unit tests:
```
{
"crm": {
"authtoken": "..."
},
"invoice": {
"authtoken": "..."
},
"support": {
"authtoken": "..."
}
}
MIT