Recent searches


No recent searches

Embedding the Web Widget in your SharePoint site



image avatar

Rob Stack

Zendesk Documentation Team

Edited Jun 21, 2024


0

2

2 comments

Hi. There is a way to know the status of the chat using zE Api (If twe are out of business hours scheduled? 
https://developer.zendesk.com/api-reference/widget-messaging/introduction/

0


image avatar

Destiny

Zendesk Customer Care

Hello there, 
 
With the Web Widget API, you can utilize the chat:departments API to know the operating hours of a department. This method returns an array of the active departments for the account. Each department object includes properties like status, which indicates whether the department is within operating hours (online) or not (offline).
 
Here's an example:
 
zE('webWidget:get', 'chat:departments', function(departments){
departments.forEach(function(department){
console.log(`Department: ${department.name}, Status: ${department.status}`);
});
});
 
However, there doesn't seem to be a direct method to get the account-wide operating hours. That's typically set on a per-department basis.
 
You can also check the status of the chat using zE('webWidget:get', 'chat:status'), but this may not reflect the business hours, rather it would demonstrate the status of the actual chat (e.g., connecting, connected, closed).
 
You can find more information about the API here https://developer.zendesk.com/api-reference/widget/settings/#departments 

0


Please sign in to leave a comment.