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.
Sample Request:
https://srinivas-ukb.salesforceliveagent.com/chat/rest/Visitor/Availability?Availability.ids=573280000l,573000004,5730I00000&deployment_id=57228000000&org_id=00D280000
Sample Response:
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:
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.
Sample Request:
https://srinivas-ukb.salesforceliveagent.com/chat/rest/Visitor/Availability?Availability.ids=573280000l,573000004,5730I00000&deployment_id=57228000000&org_id=00D280000
Sample Response:
{ "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..!
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