By default, in Salesforce, the Chat API returns queue position information that we can relay to customers. However, we can also retrieve/receive the estimated wait time. Sometimes, the estimated wait time more effectively conveys the right information to customers rather than a queue position number. Note that this estimated wait time Salesforce Chat API feature is available in API version 47.0 and later.
Use the below steps for getting the Estimated Wait Time from the Chat API.
1. Go to Chat Settings.
2. Get the Chat API.
3. Go to Deployments.
4. Open the Chat Deployment.
5. Get the Chat Deployment Id and the Version.
6. Use Postman or SOAP UI or any REST API Explorer. Use GET method and use the Endpoint URL from step 2 and add /Visitor/Availability path to it.
7. Set X-LIVEAGENT-API-VERSION to the version of the Chat Deployment from Step 5.
8. Set the below params.
org_id=Salesforce Org Id
deployment_id=id of the chat deployment(from step 5)
Availability.needEstimatedWaitTime=1
Availability.ids=id of the chat button(Go to Chat Buttons & Invitations in Setup to get the button Id. You can pass multiple ids using [id1,id2,…])
When Agent(s) is/are available:
When Agent(s) is/are not available: