Initialization

To access any of these methods and initialize the widget, you must include "ZohoDeskClientSDK.min.js" library in your widget and commence your scripting with the 'ZOHODESK.extension.onload()' function as given.

Copied<script src="https://js.zohostatic.com/support/developer_sdk/v1/js/
ZohoDeskClientSDK.min.js"></script>
<script type="text/javascript">
  window.onload = function(){
    ZOHODESK.extension.onload().then((App)=>{
      // your code here
      console.log(App);
    }) 
  }
</script>
Responses

'App' represents the object or instance of the extension application. It is the resolved value returned by the 'onload()' promise of the Zoho Desk extension. Once the extension is loaded and initialized, the 'App' object can be accessed.

By default, a set of responses will be passed when the extension is initialized, and these responses and their details might be required. Those default responses are listed and delineated below:

  • App
    • App.instance
    • App.meta
App
KeyDescription
instanceIt's an object which contains an instance of a widget including a set of methods to facilitate inter-widget communication.
uniqueIDIt is the unique ID of the widget. To get a widget instance using App.instance methods
localeProvides the locale code with respect to the chosen language by the user. To know about the supported language references, click here.
localeResourcesProvides the JSON resource based on the language selection from the extension translation files.
locationShows the location of the current widget.
metaProvides some extra information to be used in the extension, such as type of DC, platform, userPreference., etc.
 
App.instance

All the methods (getWidgetInstance, getWidgets, emit, on, and modal) available in the instance allow the widgets to communicate. These methods provide the required information about the widget and act as a communication gateway between widgets in the extension. For further information, click here.

KeyDescription
getWidgetInstanceIt is a method used to fetch the details of current widget instance using the uniqueId.
getWidgetsIt is a method provided to get all the widgets of your current extension.
emitIt is a method served to emit as an event when any UI action is triggered in the widget.
onIt is a method used to listen for the event from another widget.
modalIt is a method used to convey the basic usage of the key/UI element. For more details, click here.
App.meta
KeyDescription
dcTypeProvides the type of current user data controller whose values can be US, AU, CN, JP, EU, and IN.
platform

Provides details of the device, like browser, OS installed and resolution size which can be changed as per the UI element.


Example: {
"os": {
"name": "Mac OS",
"version": "10.15.7"
},
"browser": {
"name": "Chrome",
"version": "102.0.5005.61",
"major": "102"
},
"resolution": "1512X982"
}

serviceDefault service will be zohodesk
sigmaExecutionDomainIt is used to invoke call to the sigma function from a widget by request helper
userPreferencesProvides the appearance, theme, and fontFamily used by the user.
deskDomainUrls

Current desk URL of the user's org

Example:
US: https://desk.zoho.com
IN: https://desk.zoho.in 

threadId

ID of the thread. 

Note: Currently, you can fetch the threadId from the "desk.ticket.thread.moreaction" location only.