Fetch agent details and availability status before raising ticket

Is it possible to fetch “agent’s availability status” and “agent details” before connecting them to the end users?

@Sakshi_Mishra You will not get these details before creating the ticket. You can raise a feature request for this if really needed.

In these, you can get working hours in the condition node(Refer SS1) if you enable and configure working hours in inbox settings (Refer SS2)


Thanks @Parthiban_J. I actually want to maintain the database, for which agent got connected to whom as well as, how many tickets are scheduled to a particular agent, in order to handle some edge cases.

In that case, you will get the details while closing the ticket @Sakshi_Mishra You can use that details to store it in DB. Hope this will work.

Even after the ticket was resolved, how do we fetch agent’s details(the agent who resolved the ticket)?

@Sakshi_Mishra In the event hub, enable ticket-closed events. Then you can able to get it from a ticket-closed event.

{
    "code": "ticket-closed",
    "data": [],
    "ticketData": {
        "tags": [],
        "responded": false,
        "ticketType": "livechat",
        "ticketCsatScore": null,
        "agentCsatScore": null,
        "comments": [],
        "assignedByAdmin": false,
        "manualAssignment": false,
        "lastAgentMessageTime": null,
        "lastUserMessageTime": null,
        "lastBotMessageTime": null,
        "userActiveStatus": null,
        "agentActiveStatus": null,
        "replyCount": 0,
        "userReplyCount": 0,
        "voiceCall": false,
        "sipCall": false,
        "agentCurrentHandlingTicketsCount": 1,
        "autoStartCall": false,
        "autoTranslate": false,
        "autoDetectLanguage": false,
        "preferredAgent": false,
        "preferredAgentFallback": false,
        "createdFromProactiveNotification": false,
        "unreadCount": 0,
        "_id": "6405a784e017246ee06a4470",
        "botId": "x1658839697864",
        "uid": "140820112695519588782942660229",
        "source": "yellowmessenger",
        "issue": "asd",
        "priority": "MEDIUM",
        "severity": "MEDIUM",
        "contact": {
            "phone": "9597173727",
            "name": "Parthiban",
            "email": "parthiban@yellow.ai"
        },
        "contactId": null,
        "userLanguage": "en",
        "maximumAssignedCount": "",
        "ticketId": "100075",
        "isNewTicket": false,
        "logs": [],
        "timestamp": "2023-03-06T08:42:44.185Z",
        "reassignmentLog": [],
        "lastMessageTime": 1678092164185,
        "collaborators": [
            {
                "_id": "6405a784e017241d2a6a4492",
                "username": "parthibanyellowai",
                "xmppUsername": "user_WL9iaX7NuhMAhp4MX2BEA",
                "name": "Parthiban J"
            }
        ],
        "assignedTo": "parthibanyellowai",
        "agentLanguage": "en",
        "status": "RESOLVED",
        "assignedTime": "2023-03-06T08:42:44.261Z",
        "xmpp": "user_WL9iaX7NuhMAhp4MX2BEA",
        "createdAt": "2023-03-06T08:42:44.264Z",
        "updatedAt": "2023-03-06T08:42:51.683Z",
        "__v": 0,
        "resolvedTime": "2023-03-06T08:42:51.682Z",
        "agentProfile": {
            "id": 69993,
            "owner": "x1658839697864",
            "username": "parthibanyellowai",
            "user_id": 82675,
            "name": "Parthiban J",
            "profile_picture": "https://cdn.yellowmessenger.com/YCxnyq7Lo0L31563442773004.png",
            "description": "Support Agent",
            "max_conn_tickets": 50,
            "call_enabled": false,
            "voip_call_enabled": false,
            "voip_password": null,
            "voip_username": null,
            "webrtc_username": null,
            "languages": null,
            "email": "parthiban@yellow.ai",
            "xmpp_username": "user_WL9iaX7NuhMAhp4MX2BEA"
        }
    },
    "agentProfile": {
        "id": 69993,
        "owner": "x1658839697864",
        "username": "parthibanyellowai",
        "user_id": 82675,
        "name": "Parthiban J",
        "profile_picture": "https://cdn.yellowmessenger.com/YCxnyq7Lo0L31563442773004.png",
        "description": "Support Agent",
        "max_conn_tickets": 50,
        "call_enabled": false,
        "voip_call_enabled": false,
        "voip_password": null,
        "voip_username": null,
        "webrtc_username": null,
        "languages": null,
        "email": "parthiban@yellow.ai",
        "xmpp_username": "user_WL9iaX7NuhMAhp4MX2BEA"
    },
    "autoClose": false,
    "agentWhoClosed": "parthibanyellowai"
}
1 Like

Got it. This helps. Thanks @Parthiban_J
Any way to get their availability status before raising a ticket?

@Sakshi_Mishra You can use the below API for getting agent availability and details before raising the ticket.

curl --location 'https://cloud.yellow.ai/api/agents/reps/getAgentAvailabilities?bot=<BOT ID>' \
--header 'x-api-key: <API KEY>'
1 Like

Awesome. Thanks @Parthiban_J