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:

 

PropertyRequestResponse
iduser.id{'status':'success','user.id':'3456786789'}
fullNameuser.fullName{'status':'success','user.fullName':'Lawrence'}
emailuser.email{'status':'success','user.email':'support@zohodesk.com'}
tzoffsetuser.tzoffset{'status':'success','user.tzoffset':'330'}
timeZoneuser.timeZone{'status':'success','user.timeZone':'Asia/Kolkata'}
portalsuser.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:

PropertyRequestResponse
planportal.plan{'status':'success','portal.plan':'Enterprise Edition'}
idportal.id{'status':'success','portal.id':'54516290'}
nameportal.name{'status':'success','portal.name':'portalname'}
customDomainNameportal.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:

PropertyRequestResponse
listZOHODESK.get('department.list'){'status':'success','department.list':[{'name': 'department name', 'depid': '1234567890123', 'agents': ['1234567890'], 'isActive': true, 'isPrivate': false }'}
infoZOHODESK.get('department.info',{id : '<departmentId>'}){'status':'success','department.list':[{'name': 'department name', 'depid': '1234567890123', 'agents': ['1234567890'], 'isActive': true, 'isPrivate': false }'}
idZOHODESK.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:

PropertyRequestResponse
contactIdcurrentCall.contactId{'status':'success','currentCall.contactId':'271230063478992'}
numbercurrentCall.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"
}