JS SDK Library

JS SDK Library

JS SDK URL to be included in your code before calling the following SDK methods:
To register listeners with widgets:
Use the following code snippet to initialize your widget and start listening to events in your Zoho People application.
Quote
ZOHO.embeddedApp.init();

Get form id

Supported only for Related list and custom button widgets.
To get form id where the widget is currently rendered, use:
Quote
ZOHO.People.API.getFormId()

Response

Quote
String(record id)

Get form field components

To get form field components, use:
Quote
ZOHO.People.API.getFormComponents();

Response

Quote
[{
"comptype": "Text",
"ismandatory": true,
"descriptionType": 0,
"displayname": "EmployeeID",
"autofillvalue": "",
"description": "",
"formcomponentid": "115782000000020183",
"labelname": "EmployeeID",
"maxLength": 100
}, {
"comptype": "Text",
"ismandatory": true,
"descriptionType": 0,
"displayname": "Last Name",
"autofillvalue": "",
"description": "",
"formcomponentid": "115782000000020187",
"labelname": "LastName",
"maxLength": 100
}]

Add form record

To add a form record, use:
Quote
ZOHO.People.API.addFormData(inputData);
 
 inputData
 JSON Input: 
 
 {formName:<form name>, input:{LabelName:value, LabelName1:value}};

  For formName - Refer here

 For LabelName - Refer here

 

Response

Quote
Success Response: Data added successfully
Failure Response: Error occurred

Update form record

To update the form record, use:
Quote
ZOHO.People.API.updateFormData(inputData);
 
 inputData
 JSON Input: 
 
 {formName:<form name>, input:{LabelName:value,   LabelName1:value},recordId:   <form record id>};

 For formName - Refer here

Response

Quote
Success Response: Data updated successfully
Failure Response: Error occurred

Get record id

Supported only for Related list and custom button widgets.
To get record id of the record in which the widget is currently rendered, use:
Quote
ZOHO.People.API.getRecord()

Get form data by record id

To get form data by record id use:
Quote
ZOHO.People.API.getFormRecord(inputData):

 
 inputData

 JSON Input: 

 {recordId:<record id>,formName: <form name>};
 For formName - Refer here

 

Info
Current form record id can be get from ZOHO.People.API.getRecord()

Response  

Quote
{"LabelName": value, "LabelName1":value2,"LabelName_downloadUrl":file upload field download url}

Get bulk form records

To get bulk form records, use:
Quote
ZOHO.People.API.getBulkRecords(inputData)
 inputData



 JSON Input: 
 
 {formName:<form name>,startIndex:<from limit>,limit:<to limit>}


 startIndex- not mandatory, default value -1
 limit- not mandatory, default value - 200

Response

Quote
[{"LabelName": value, "LabelName1":value2,"LabelName_downloadUrl":file upload field download url}, {"LabelName": value1, "LabelName1":value22,"LabelName_downloadUrl":file upload field download url},
]

Get form data sectionalise

To get form data by section, use
Quote
ZOHO.People.API.getFormDatabySection(inputData)
inputData
 JSON Input: 
 
 {formName:<formName>,recordId:<record id>}

For formName - Refer here

Response

Quote
[
{
"Section1": {
"Label name": value, "Label name": value
},
"Section2": {
"Label name": value, "Label name": value
},
"tabularSections": {
"Label name": [
{
"Label name": value, "Label name": value
}
],
"ApprovalStatus": "Approval Not Enabled"
}
]

Download form file

To download the form file, use:
Quote
ZOHO.People.API.downloadFormFile(inputData);
 
 inputData
 JSON Input: 
 
 {fcId:<form component id>,recordId:<form record id>,formId:<form id>}

Response

Quote
File Content

Get file categories

To get file categories, use:
Quote
ZOHO.People.API.getFileCategories();

Response

Quote
[{"CatID":"1","CatName":"Test"},{"CatID":"2","CatName":"Test1"}]

Upload employee files

To upload a file, use:
Quote
ZOHO.People.API.uploadEmployeeFile(fileInput);
 
 fileInput
 JSON Input: 
 
 {uploadfile:<Blob or file>, fileName: <File name>, employeeId:<empId>,fileDesc:   <Description>,catId:<CategoryId>};

 To get catId, use:
Quote
ZOHO.People.API.getFileCategories();

Response

Quote
Success Response: Data added successfully

Call third party APIs

To call third party APIs, use:
Quote
ZOHO.People.Http.post(requestObj);
 
 inputData
 JSON Input: 
 
 var requestObj = {
            url : url,
            header:  {'Authorization'':"Zoho-oauthtoken-__token"}
 params: {};
 };

Notes
Zoho-oauth is for invoking Zoho Services api.

Response

Response from the api.

Invoke API via Connections

To invoke API via Connections, use:
Quote
ZOHO.People.API.invokeUrl(requestData);
inputData






JSON Input

var requestData = {url: <url to invoke>,
connectiondetails:"name=<connection-name>",
params : <url params>, // optional
methodType: <GET|POSTPUT|DELETE>;
extraParam={"Content-Type" : "application/json"};// optional
};  

Response

Response from the api.

Sample widget code

  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <meta charset="UTF-8">
  5.     <script src="https://static.zohocdn.com/zp5/widgets/zpwidgetsdk.min.js"></script>
  6.     <script>
  7.     window.onload = function () {
  8.       // initialize the widget, before invoking any js sdk method
  9.       ZOHO.embeddedApp.init().then(function() {
  10.         ZOHO.People.API.getRecord().then(function(record) { 
  11.           ZOHO.People.API.getFormRecord({formName:"employee",recordId:record}).then(function(recordData){
  12.             console.log(recordData);
  13.           });
  14.         });
  15.       });
  16.     }       
  17.   </script>
  18.   </head>
  19.   <body>
  20.     <h2>This is a sample widget to get form record.</h2>
  21.   </body>
  22. </html>

    Access your files securely from anywhere

      Zoho CRM Training Programs

      Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

      Zoho CRM Training
        Redefine the way you work
        with Zoho Workplace

          Zoho DataPrep Personalized Demo

          If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

          Zoho CRM Training

            Create, share, and deliver

            beautiful slides from anywhere.

            Get Started Now


              Zoho Sign now offers specialized one-on-one training for both administrators and developers.

              BOOK A SESSION






                          Quick Links Workflow Automation Data Collection
                          Web Forms Enterprise Begin Data Collection
                          Interactive Forms Workplace Data Collection App
                          Offline Forms Customer Service Accessible Forms
                          Digital Forms Marketing Forms for Small Business
                          HTML Forms Education Forms for Enterprise
                          Contact Forms E-commerce Forms for any business
                          Lead Generation Forms Healthcare Forms for Startups
                          Wordpress Forms Customer onboarding Order Forms for Small Business
                          No Code Forms Construction RSVP tool for holidays
                          Free Forms Travel
                          Prefill Forms Non-Profit

                          Intake Forms Legal

                          Form Designer HR

                          Card Forms Food
                          Assign Forms Photography

                          Translate Forms Real Estate
                          Electronic Forms

                          Notification Emails for Forms Alternatives
                          Holiday Forms Google Forms alternative 
                          Form to PDF Jotform alternative





                                            You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                                Manage your brands on social media

                                                  Zoho Desk Resources

                                                  • Desk Community Learning Series


                                                  • Digest


                                                  • Functions


                                                  • Meetups


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner


                                                  • Word of the Day


                                                    Zoho Marketing Automation

                                                      Zoho Sheet Resources

                                                       

                                                          Zoho Forms Resources


                                                            Secure your business
                                                            communication with Zoho Mail


                                                            Mail on the move with
                                                            Zoho Mail mobile application

                                                              Stay on top of your schedule
                                                              at all times


                                                              Carry your calendar with you
                                                              Anytime, anywhere




                                                                    Zoho Sign Resources

                                                                      Sign, Paperless!

                                                                      Sign and send business documents on the go!

                                                                      Get Started Now




                                                                              Zoho TeamInbox Resources



                                                                                      Zoho DataPrep Resources



                                                                                        Zoho DataPrep Demo

                                                                                        Get a personalized demo or POC

                                                                                        REGISTER NOW


                                                                                          Design. Discuss. Deliver.

                                                                                          Create visually engaging stories with Zoho Show.

                                                                                          Get Started Now









                                                                                                              • Related Articles

                                                                                                              • Custom Widget - Introduction

                                                                                                                What is a custom widget? Customize your Zoho People application user interface with custom widgets, which are embeddable user interface components that you can create and add to your Zoho People application. You can build widgets for Zoho People ...
                                                                                                              • Create Widget Using Zet-CLI Tool

                                                                                                                The Zoho Extension Toolkit (ZET) is a command-line interface designed to assist developers in creating and packaging widgets for integration with Zoho People. Prerequisites Download the nodejs source code from https://nodejs.org/en Use the following ...
                                                                                                              • Developer Space

                                                                                                                What is Developer Space in Zoho People? The developer space in Zoho People has three functionalities: View Zoho People APIs categorized by form. Create and manage Connections. Create and manage Custom Widgets. These features can help extend Zoho ...
                                                                                                              • Custom Widget

                                                                                                                Custom widgets are embeddable user interface components that you can create and add to your Zoho People application. Widgets can be used to extend the application's front-end capabilities according to your requirements. Use widgets to perform ...
                                                                                                              • Zoho People 5.0 - What has changed?

                                                                                                                Changes in Home tab and Self Service Zoho People 4.0 Zoho People 5.0 Landing page is Home > Dashboard Self Service page: New Landing page is Home > My Space > Overview (Replacement for Self service in Zoho People 4.0 with additional features). ...
                                                                                                                Wherever you are is as good as
                                                                                                                your workplace

                                                                                                                  Resources

                                                                                                                  Videos

                                                                                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                                  eBooks

                                                                                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                                  Webinars

                                                                                                                  Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                                  CRM Tips

                                                                                                                  Make the most of Zoho CRM with these useful tips.



                                                                                                                    Zoho Show Resources