Global Methods
In this method, the objects can be accessed from any widget locations.
User Object
User Object returns the information of the user who is logged into the Zoho Desk portal. It can be accessed from any widget location. Based on your requirements, you can either retrieve all of the user's information or select specific information.
The properties related to the User object are listed below:
Property | Request | Response |
---|---|---|
id | user.id | {'status':'success','user.id':'3456786789'} |
fullName | user.fullName | {'status':'success','user.fullName':'Lawrence'} |
user.email | {'status':'success','user.email':'support@zohodesk.com'} | |
tzoffset | user.tzoffset | {'status':'success','user.tzoffset':'330'} |
timeZone | user.timeZone | {'status':'success','user.timeZone':'Asia/Kolkata'} |
portals | user.portals | {'status':'success','user.portals':{'myportal':'3456789'}} |
Sample Request
Copied//To get entire user information
ZOHODESK.get("user").then(function(userResponse){
console.log(userResponse["user"]);
// your code here...
}).catch(function(error){
//handle your error here...
})
// To get the particular property of the user
ZOHODESK.get("user.email").then(function(userResponse){
console.log(userResponse["user.email"]);
// Your code here...
}).catch(function(error){
//handle your error here...
})
Sample Response
Copied// Entire user response
{
"user" : {
"id" : "4567890",
"fullName" : "Desk Platform",
"email" : "deskplatform@zoho.com",
"tzoffset" : "330",
"timeZone" : "Asia/Kolkata",
"portals" : {
"platformportal" : "13264433"
}
},
"status" : "success"
}
// Particular user property response
{
"user.email" : "deskplatform@zoho.com",
"status" : "success"
}
Portal Object
Portal Object returns the information of portals in ZOHO DESK. It can be accessed from any widget location. Based on your requirements, you can either retrieve all of the portal's information or select specific information.
The properties related to the Portal object are listed below:
Property | Request | Response |
---|---|---|
plan | portal.plan | {'status':'success','portal.plan':'Enterprise Edition'} |
id | portal.id | {'status':'success','portal.id':'54516290'} |
name | portal.name | {'status':'success','portal.name':'portalname'} |
customDomainName | portal.customDomainName | {'status':'success','portal.customDomainName':'https://customdomainname.com/'} |
Sample Request
Copied//To get current portal information
ZOHODESK.get("portal").then(function(portalResponse){
console.log(portalResponse["portal"]);
// your code here...
}).catch(function(error){
//handle your error here...
})
// To get the particular property of the portal
ZOHODESK.get("portal.name").then(function(portalResponse){
console.log(portalResponse["portal.name"]);
// Your code here...
}).catch(function(error){
//handle your error here...
})
Sample Response
Copied// Current selected portal response
{
"portal" : {
"id" : "4567890",
"name" : "platformportal",
"plan" : "Enterprise Edition",
"customDomainName" : null
},
"status" : "success"
}
// Particular portal property response
{
"portal.name" : "platformportal,
"status" : "success"
}
Department Object
Department Object helps you to fetch the information of Departments in ZOHO DESK. It can be accessed from any widget location.
The properties related to the department object are listed below:
Property | Request | Response |
---|---|---|
list | ZOHODESK.get('department.list') | {'status':'success','department.list':[{'name': 'department name', 'depid': '1234567890123', 'agents': ['1234567890'], 'isActive': true, 'isPrivate': false }'} |
info | ZOHODESK.get('department.info',{id : '<departmentId>'}) | {'status':'success','department.list':[{'name': 'department name', 'depid': '1234567890123', 'agents': ['1234567890'], 'isActive': true, 'isPrivate': false }'} |
id | ZOHODESK.get('department.id') | {'status':'success','department.id'.'123456789012345678'} |
Sample Request
Copied//To get current department ID
ZOHODESK.get("department.id").then(function(departmentResponse){
console.log(departmentResponse["department.id"]);
// your code here...
}).catch(function(error){
//handle your error here...
})
// To get the particular department information
ZOHODESK.get("department.info", { id : "1234" }).then(function(departmentResponse){
console.log(departmentResponse["department.info"]);
// Your code here...
}).catch(function(error){
//handle your error here...
})
// To get the departments list information
ZOHODESK.get("department.list").then(function(departmentResponse){
console.log(departmentResponse["department.list"]);
// Your code here...
}).catch(function(error){
//handle your error here...
})
Sample Response
Copied// Department ID response
{
"department.id" : "12345"
"status" : "success"
}
// Department info response
{
"department.info" : [{
"isActive": true,
"isPrivate": true,
"depid": "271540000000006907",
"name": "deskplatform",
"agents": [
"271540000000883156"
]
}],
"status" : "success"
}
// Department list response
{
"department.list" : [{
"isActive": true,
"isPrivate": true,
"depid": "271540000000006907",
"name": "deskplatform",
"agents": [
"271540000000883156"
]
}],
"status" : "success"
}
Current Call Object
Current Call object returns the caller information when an incoming call is received at the ZOHO DESK. It can be accessed from any widget location.
The properties related to the current call object are listed below:
Property | Request | Response |
---|---|---|
contactId | currentCall.contactId | {'status':'success','currentCall.contactId':'271230063478992'} |
number | currentCall.number | {'status':'success','currentCall.number':'1 888 900 9646'} |
Sample Request
CopiedZOHODESK.get("currentCall.number").then(function(response) {
console.log(response["currentCall.number"]);
//your code here...
}).catch(function(err){
// handle your error here...
})
Sample Response
Copied{
"currentCall.number" : "56789033353",
"status" : "success"
}