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
Key | Description |
---|---|
instance | It's an object which contains an instance of a widget including a set of methods to facilitate inter-widget communication. |
uniqueID | It is the unique ID of the widget. To get a widget instance using App.instance methods |
locale | Provides the locale code with respect to the chosen language by the user. To know about the supported language references, click here. |
localeResources | Provides the JSON resource based on the language selection from the extension translation files. |
location | Shows the location of the current widget. |
meta | Provides 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.
Key | Description |
---|---|
getWidgetInstance | It is a method used to fetch the details of current widget instance using the uniqueId. |
getWidgets | It is a method provided to get all the widgets of your current extension. |
emit | It is a method served to emit as an event when any UI action is triggered in the widget. |
on | It is a method used to listen for the event from another widget. |
modal | It is a method used to convey the basic usage of the key/UI element. For more details, click here. |
App.meta
Key | Description |
---|---|
dcType | Provides 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.
|
service | Default service will be zohodesk |
sigmaExecutionDomain | It is used to invoke call to the sigma function from a widget by request helper |
userPreferences | Provides the appearance, theme, and fontFamily used by the user. |
deskDomainUrls | Current desk URL of the user's org Example: |
threadId | ID of the thread. Note: Currently, you can fetch the threadId from the "desk.ticket.thread.moreaction" location only. |