Node.js Zoho helper library for integrating Zoho Creator, CRM, Invoice and Support.
$ npm install zoho
- Zoho Creator
- Zoho CRM
- Zoho Invoice
- Zoho Support
Initialize zoho
var Zoho = require('zoho');
Initialize Creator
with an object authtoken
var creator = new Zoho.Creator({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
Set a cookie for "unofficial" API calls that require direct HTTP schemes.
creator.setCookie('somecookie');
creator.viewRecordsInView('sample','Employee_View', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
addRecords(<string> applicationLinkName, <string> formLinkName, <object> params, <function> callback)
Add records.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-add-records.html
editRecords(<string> applicationLinkName, <string> formLinkName, <object> params, <function> callback)
Edit records.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-edit-records.html
deleteRecords(<string> applicationLinkName, <string> formLinkName, <object> params, <function> callback)
Delete records.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-delete-records.html
viewRecordsInView(<string> applicationLinkName, <string> formLinkName, <object> params, <function> callback)
Get records in view.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-view-records-in-view.html
listFormFields(<string> applicationLinkName, <string> formLinkName, <object> params, <function> callback)
List form fields.
See https://www.zoho.com/creator/help/api/rest-api/rest-api-list-form-fields.html
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.
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));
});
Initialize CRM
with an object authtoken
var crm = new Zoho.CRM({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
crm.getRecords('leads', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
Initialize Invoice
with an object authtoken
var invoice = new Zoho.Invoice({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
invoice.getRecords('contacts', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
Initialize Support
with an object authtoken
var support = new Zoho.Support({
authtoken: 'bad18eba1ff45jk7858b8ae88a77fa30'
});
support.getRecords('contacts', function (err, data) {
if (err) {
return console.log(err);
}
console.log(data);
});
##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.
##Licence The MIT License (MIT)
Copyright (c) 2015 Andrés González Aragón, 4yopping and all the related trademarks
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.