Friday, December 6, 2019

Live Agent REST API To Check Whether Agents Are Available(in Online or Not)

If you want to check whether any agent is available or not to take the new chat,then first we need to check whether a particular button is available to take the request or not.

Because agents are tagged under a particular button,if button status is online it means agents are under the same button is available to take the request.

Please look at the API details below


This api basically takes the list of button ids to which you want to verify ,if specified button id is online it will returns the flag called isAvailable or else isAvailable will not be present in the response.


EndPoint : 


https://HostName/chat/rest/Visitor/Availability?Availability.prefix=Visitor&Availability.ids=[List of Button Ids]&deployment_id=DeploymentId&org_id=OrganizationId

Headers:
X-LIVEAGENT-API-VERSION:34

Content-Type:application/json


Query parameters:

  • org_id - The ID of the Salesforce organization that’s associated with the Live Agent deployment.
  • deployment_id - The 15-digit ID of the Live Agent deployment that the chat request was initiated from.
  • Availability.ids - A comma separated button object IDs for which to verify availability.


{
"messages": [
{
"type": "Availability",
"message": {
"results": [
{
"id": "573280000l",
"isAvailable": true // Agents are available to accept new chat request 
},
{
"id": "573000004" // No agents are available to accept new chat request 
},
{
"id": "5730I00000",
"isAvailable": true //Agents are available to accept new chat request
}
]
}
}
]
}


Hope this helps you..Enjoy..!


1 comment:

  1. This is a great article with lots of informative resources. I appreciate your work this is really helpful for everyone. Check out our website Bing Search Api for more related info!

    ReplyDelete