Skip to main content

Queue Status

After the embed script has been created you can use embed functions to get status data from your One-to-one service. You can use this data on your website to customise the design or behavior of your choice.

Availability

These functions below are only available for Queue Calls

Opening Hours Status

In the dashboard you can set the opening hours for queues. If nothing is set in there they will be considered opened. Function areQueuesOpen returns whether or not the queues are currently open. This can be used if you e.g. want to hide a certain element when the queues are closed.

Example usage:

window.oneToOneEmbed.areQueuesOpen().then((response) => {
// Use the response for your own purposes

// Disable a button if the queue is closed
if (response.isOpen === false) {
document.getElementById("bambuser-one-to-one").disabled = true
};

});

The response will be in the shape of an object like this (with the queue being opened in this example):

{
isOpen: true,
}

Amount of agents online on a queue

Function getNumberOfOnlineAgents returns how many agents that currently are available on a specific queue. This function takes in one string parameter that is the queue identifier. If no queue is specified you will get the status of the default queue.

Example usage:

window.oneToOneEmbed.getNumberOfOnlineAgents('QUEUE_ID_HERE').then((response) => {
// Use the response for your own purposes

// Change content on your site
if (response.numberOfAgentsOnline < 1) {
document.getElementById("bambuser-one-to-one-content").text = "Unfortunately there are no agents online"
};

});

The response will be in the shape of an object like this (with 123 agents being online in this example):

{
numberOfAgentsOnline: 123,
queueId: 'QUEUE_ID_HERE'
}