JS SDK

JS SDK

Prerequisite

Include the JS https://js.zohocdn.com/projects/js/client_sdk.min.js in your code before calling the following SDK methods.
Include the CSS https://css.zohocdn.com/projects/styles/zps-extn/client_sdk.css in your code to use Zoho Projects style.

init

Initializes the extension.


zohoprojects.init().then(function(){});                                          
 
Invoking this method at the beginning is necessary since the other SDK methods will work only after its invocation. While init is loading if you want to use other functions you can use it within the init function.


 zohoprojects.init().then(function () {
      zohoprojects.get("portal.name").then(function (response) 
      });

metadata

Fetches the payment and configuration details of an extension.

zohoprojects.metadata().then(function(response)
  {
       /* output
  {
        "data": {
        "configs": [
             {
             "name": "Name",
             "type": "text",
             "is_mandatory": true,
             "is_secure": false,
             "description": "Enter your name",
             "value": "Helen Collins"
               },
                {
                 "name": "Employee ID",
                 "type": "text",
                 "is_mandatory": true,
                 "is_secure": false,
                   "description": "Enter your Emp. ID",
                   "value": "EMP08"
                    }
                     ],
                    "payments_info": {
                     "edition": "trial"
                     },
                     "status": "success"
                      }
                     }
                    */
           });                              

context

Fetches the module name and entity ID of the current location. The module name is 'tasks' or 'issues' and the entity ID is the ID of the respective task or issue.


 zohoprojects.context().then(function(response)
 {
 /* output
 {
     "module_name": "tasks",
      "entity_id": "27092000000031079"
  }
     */
      });                                         

 We do not give the entity ID for the widget location 'app_settings'.

get

Fetches the details of the instances, current user, portal, project, tasks, and issues of the current location.


zohoprojects.get("task.id
").then(function(response)
{
/* output
 {
"data": 27092000000031080,
"status": "success"
}
*/
});
                                                
The following are the list of keys that can be used in the get method:

Instances

  • instances

Current user

  • current_user

Portal

  1. portal.trial_enabled
  2. portal.settings
  3. portal.gmt_time_zone
  4. portal.project_count
  5. portal.role
  6. portal.avail_user_count
  7. portal.locale
  8. portal.project_prefix
  9. portal.available_projects
  10. portal.max_user_count
  11. portal.profile_id
  12. portal.name
  13. portal.id_string
  14. portal.bug_plural
  15. portal.plan
  16. portal.bug_plan
  17. portal.bug_singular
 portal.default
  18. portal.extensions
  19. portal.is_crm_partner
  20. portal.is_display_projectprefix
  21. portal.is_display_taskprefix
  22. portal.is_new_plan
  23. portal.layouts
  24. portal.link

Project

  1. project.is_strict
  2. project.role
  3. project.bug_count
  4. project.owner_id
  5. project.taskbug_prefix
  6. project.link
  7. project.description
  8. project.milestone_count
  9. project.updated_date_long
  10. project.task_count
  11. project.updated_date_format
  12. project.workspace_id
  13. project.billing_status
  14. project.key
  15. project.is_chat_enabled
  16. project.owner_name
  17. project.profile_id
  18. project.enabled_tabs
  19. project.name
  20. project.is_public
  21. project.layout_details
  22. project.status
  23. project.permissions
  24. project.IS_BUG_ENABLED
  25. project.bug_defaultview

  26. project.bug_prefix
  27. project.cascade_setting
  28. project.completed_on
  29. project.completed_on_long
  30. project.created_date
  31. project.created_date_format
  32. project.created_date_long

  33. project.custom_status_id
  34. 
project.id_string
  35. project.show_project_overview

  36. project.start_date

  37. project.start_date_long
  38. project.updated_date

  39. project.users
  40. project.customfields
  41. project.custom_fields

Task

  1. task.name
  2. task.completed
  3. task.created_by
  4. task.priority
  5. task.percent_complete
  6. task.start_date
  7. task.end_date
  8. task.dependency
  9. task.duration
  10. task.details
  11. task.link
  12. task.created_person
  13. task.created_time
  14. task.created_time_format
  15. task.created_time_long

  16. task.custom_fields
  17. task.depth (applicable for subtasks only)
  18. task.duration_type

  19. task.id_string
  20. task.is_comment_added

  21. task.is_forum_associated

  22. task.is_recurrence_set

  23. task.is_reminder_set
  24. task.isparent
task.key

  25. task.last_updated_time
  26. task.last_updated_time_format

  27. task.last_updated_time_long
  28. task.milestone_id

  29. task.order_sequence
  30. task.parent_task_id (applicable for subtasks only)
  31. task.parenttask_id (applicable for subtasks only)
  32. task.root_task_id (applicable for subtasks only)
  33. task.status
  34. task.task_followers
  35. task.tasklist
  36. task.work
task.work_type
  37. task.comments
  38. task.subtasks

  39. task.customfields
  40. task.attachments

Issue

  1. issue.module
  2. issue.created_time_long
  3. issue.customfields
  4. issue.status
  5. issue.reproducible
  6. issue.link
  7. issue.severity
  8. issue.reported_person
  9. issue.title
  10. issue.flag
  11. issue.assignee_name
  12. issue.reporter_id
  13. issue.classification
  14. issue.created_time_format
  15. issue.closed
  16. issue.created_time
  17. issue.key
  18. issue.attachment_count
  19. 
issue.bug_number
  20. 
issue.bug_prefix

  21. issue.comment_count
  22. 
issue.escalation_level
  23. 
issue.id_string

  24. issue.reporter_email
  25. 
issue.reporter_non_zuser
  26. 
issue.updated_time
  27. 
issue.updated_time_format
  28. 
issue.updated_time_long
  29. issue.attachments
  30. issue.comments
  31. issue.views

Milestone

  1. milestone.closed
  2. milestone.comments_count
  3. milestone.created_time
  4. milestone.created_time_format
  5. milestone.created_time_long
  6. milestone.end_date
  7. milestone.end_date_format
  8. milestone.end_date_long
  9. milestone.flag
  10. milestone.has_comments
  11. milestone.id
  12. milestone.id_string
  13. milestone.is_workfield_removed
  14. milestone.last_updated_time
  15. milestone.last_updated_time_format
  16. milestone.last_updated_time_long
  17. milestone.link
  18. milestone.name
  19. milestone.owner_id
  20. milestone.owner_name
  21. milestone.owner_zpuid
  22. milestone.project
  23. milestone.sequence
  24. milestone.start_date
  25. milestone.start_date_format
  26. milestone.start_date_long
  27. milestone.status
  28. milestone.status_det

Chosen files

A file that is in queue to be uploaded is stored in chosen_files.This key is supported only for attachment picker.
  • chosen_files

Deployment type

Get current data center.

zohoprojects.get("deployment_type").then(function() {
/* output
com
 */
 });
                                                

Profile

We support a couple of keys that fetch all the profiles at the portal level and the profile details of the current user respectively.
  1. all_profiles: Fetches the information of all the profiles in a portal.
  2. current_profile: Fetches the profile details of the current user.

Theme

Zoho Projects supports themes for your portal.
  • current_theme: Fetches the current theme.
zohoprojects.get("current_theme").then(function() {
 /* output
{mode: "default", zpPrimary: "255, 100, 0", zpPrimaryHover: "255, 247, 243"}
 */
 });
                                                

Blueprint During

  • blueprint_during: fetches the value set for the During action
zohoprojects.get("blueprint_during").then(function(res) {
 /* output
[ {field_id: "UDF_CHAR1", is_visible: true, is_pii: false, is_encrypted: false}
{field_id: "UDF_CHAR2", is_visible: true, is_pii: false, is_encrypted: false}]
 */
});

set

Updates the attributes of a specific task or an issue of the current location.


var nameObj={name:"Create a new checklist"};
zohoprojects.set("task",nameObj).then(function(response)
  {
    /* output
   {
   "data": {
   "tasks": [
     {
      "milestone_id": "2*******************2",
       "link": {
       "timesheet": {
          "url": "https://p*************e.********.com/restapi/portal/5******7/projects/2****************9/tasks/2****************9/logs/"
         },
         "self": {
           "url": "https://p*************e.********.com/restapi/portal/5******7/projects/2****************9/tasks/2****************9/"
          }
         },
  "description": "",
  "duration": "0",
  "last_updated_time_long": 1542193097398,
   "details": {
   "owners": [
      {
      "name": "JOHN MARSH",
       "id": "5************3"
       }
      ]
     },
"id": 2************0,
"key": "WEUT-T1",
"created_person": "Steve Banks",
"created_time_long": 1525668983347,
"created_time": "05-07-2018",
"is_reminder_set": false,
"is_recurrence_set": false,
"created_time_format": "05-07-2018 10:26:23 AM",
"subtasks": false,
"work": "0:00",
"custom_fields": [
{
"column_name": "UDF_LONG1",
"label_name": "Expense Amount",
"value": "24573"
},
{
"column_name": "UDF_LONG3",
"label_name": "sample",
"value": "0"
},
{
"column_name": "UDF_LONG2",
"label_name": "test",
"value": "200"
}
],
"isparent": false,
"work_type": "work_hrs_per_day",
"completed": false,
"priority": "None",
"created_by": "5******3",
"percent_complete": "0",
"last_updated_time": "11-14-2018",
"name": "Create a new checklist",
"id_string": "2************9",
="last_updated_time_format": "11-14-2018 04:28:17 PM",
"tasklist": {
"name": "General",
"id": "2************7"
},
"order_sequence": 1,
"status": {
"name": "Open",
"id": "2************1",
"type": "open",
"color_code": ""
}
}
]
},
"status": "success"
}
*/
});                                           
The following keys can be used in the set method for tasks:

Tasks

  1. person_responsible
  2. owner_work
  3. work_type
  4. name
  5. start_date
  6. end_date
  7. start_time
  8. end_time
  9. percent_complete
  10. duration
  11. duration_type
  12. reminder
  13. priority
  14. description
  15. custom_fields (This key can be used only to create a custom field.)
  16. clear_date
  17. index
  18. range
  19. json_string
  20. subtasks (This key can be used only to create a subtask. Click here to know the params for subtasks.)
The following keys can be used in the set method for issues:

Issues

  1. title
  2. description
  3. assignee
  4. flag
  5. classification_id
  6. milestone_id
  7. due_date
  8. module_id
  9. severity_id
  10. reproducible_id
  11. status_id
  12. resolution
  13. affectedmile_id
The following keys can be used in the set method to update project:

Projects

  1. name
  2. description
  3. status
  4. start_date
  5. end_date
  6. strict_project
  7. public
  8. group_id
  9. completed_on
  10. UDF_CHAR([1-9]|[1-2][0-9]|30). Example: UDF_CHAR1
  11. UDF_TEXT([1-9]|1[0-5])
  12. UDF_LONG([1-9]|1[0-5])
  13. UDF_USER[1-5]
  14. UDF_DOUBLE([1-9]|[1-2][0-9]|3[0-5])
  15. UDF_DATE[1-5]
  16. UDF_ENCRYPT([1-9]|10)
  17. owner
  18. billing_method
  19. bill_status
  20. show_project_overview
  21. custom_status
The following keys can be used in the set method to update milestone:

Milestone

  1. name
  2. start_date
  3. end_date
  4. owner
  5. flag
  6. budget
  7. threshold
  8. revenue_budge
Use linkfiles key to associate files to your location. This key supports the following locations: Task details tabIssue details tabAttachment picker. It must be an array of maximum size 10 and the following fields are mandatory: id, name, type, permanent_url, download_url, size, created_by, created_time; preview_url is mandatory for image files.
  • linkfiles

linkfiles=[{
"created_time": 1561028014712,
"id": "1LavBS5sauJ-AAFJZWp8Ch9Cp2ehydahk",
"type": "image/jpeg",
"created_by": "Patricia Boyle",
"permanent_url": "https://***************",
"size": 7409,
"preview_url": "https://******************",
"name": "sample-image.jpeg",
"download_url": "https://drive.google.com/a/web-mailhosting.com/uc?id=1LavBS5sauJ-AAFJZWp8Ch9Cp2ehydahk&export=download",
}]
zohoprojects.set('linkfiles', linkFiles).then(function (response) {
zohoprojects.invoke('attachment_picker.close');
});

Blueprint During

Set the value when configuring the During action for a blueprint transition.


var sample = [ {field_id: "UDF_CHAR1", is_visible: true, is_pii: false, is_encrypted: false}
{field_id: "UDF_CHAR2", is_visible: true, is_pii: false, is_encrypted: false}];
zohoprojects.set("blueprint_during", sample).then(function(res) {
  /* output
[ {field_id: "UDF_CHAR1", is_visible: true, is_pii: false, is_encrypted: false}
{field_id: "UDF_CHAR2", is_visible: true, is_pii: false, is_encrypted: false}]
*/
 });                                

request

Invokes a third-party URL from your extension using the connection defined in the plugin-manifest.json file. If the connection link name is not specified then the response is provided based on the inputs.


var file = document.getElementById("inputbox").files[0];
var file_detail = {
type: "GET",
files: [{
uploaddoc : file
type : "binary" //If the file is uploaded as binary
}],
parameters: {
fields: "id,name, thumbnailLink, webViewLink, webContentLink"
}
};
var url = "https://www.googleapis.com/drive/v3/files/1-QabBt69U8myXYRDVU-1YiCo2k-JWRfu";
zohoprojects.request(url, file_detail, "google_drive").then(function (response)
 /* Output
 { 
"result": {
"webContentLink": "https://drive.google.com/uc?id=1-QabBt69U8myXYRDVU-1YiCo2k-JWRfu&export=download",
"name": "Eiffel_Tower_01.jpg",
"webViewLink": "https://drive.google.com/file/d/1-QabBt69U8myXYRDVU-1YiCo2k-JWRfu/view?usp=drivesdk",
"id": "1-QabBt69U8myXYRDVU-1YiCo2k-JWRfu",
"thumbnailLink": "https://lh3.googleusercontent.com/nhyq9mHrGDOZfNdQUHRj_xVlOoNAP5PEYkW4X2svGXKjVt53MvMGfjhQ2PlTv4cmv5-PgbjrR-c=s220"
},
"status": "success"
}
*/
});
Argument name Data type Description
URL string The third-party URL that has to be invoked from your extension.
object JSONObject Key Data type Value
    type string "GET" / "POST" / "PUT" / "DELETE" / "PATCH"
    parameters JSONObject The request params of the API.
    headers JSONObject The headers of the API.
    body JSONObject

The body of the API.

 

    files JSONArray

The parameters for uploading a file.

Value: the actual file.

*The body will be ignored if actual file is uploaded

*If you mention the type as binary, the file will sent as binary. The body of the file will also be considered

    replace_secure_config Boolean

If the is_secure parameter in the plugin-manifest.json file is true, set the value of this param to true.

Zoho Projects will replace the value in the URL.

Note: The default value is false.

connection_link_name string The connection link name generated from the zapps website.

    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









                                    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

                                                                                                      • Creating extension using CLI

                                                                                                        Overview Zoho Marketplace is an online store where you can upload the extensions you develop for any of the products of Zoho. You can also use the available extensions in our store for your business. This developer guide will help you build an ...
                                                                                                        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