This guide is in place to assist with pinging the CallTools platform to see if there are any available agents in a queue that can take inbound calls to the platform. This is helpful for many use cases including lead vendors or 3rd parties that are looking to send transfers to available agents on CallTools.
We will be using the Agent Statuses API which is documented in Swagger for reference. To get to the official endpoint documentation please login to your CallTools Account and visit Integrations then API Docs.
Once logged into Swagger search for the Agent Statuses Section.
Prerequisites
Prior to continuing with the guide below you will want to identify the variables that will be used for the GET request so that when pinging the system the proper information will be returned.
Queue ID
To get the proper Queue ID your agents will be members of please do the following.
1) Click "Contact Center"
2) Click "Queues"
3) Next to the Queue you want to ping click the 3 dots under "Controls" and then click "Settings"
4) Once on this page the Queue ID will be the last variable of the webpage in the URL of that page. Save this as this is the ID for the Queue in later steps
Login URL / Silo
The login URL is what you use each time you login to the CallTools system. This can be found in your address bar when logged into any page of the CallTools System.
Agent Status ID
This is the status you will want to ping to ensure the agent is Available and ready to take an inbound call in the system.
1) Click on Contact Center and then Agent Statuses
2) Take note of the ID of the Available Status
1. Understand the Components of the URL
The provided URL has several components:
Variables Breakdown
-
Base URL:
https://east-2.calltools.io/api/agentstatuses/- This is the main endpoint for querying agent statuses. The subdomain (
east-2) may vary depending on the client’s specific environment or server region.
-
Query Parameters:
-
queue=5457:- Identifies the specific queue being queried. Each client may have different queue IDs depending on how they have set up their system.
-
agent_status_id=20561:- Represents the status ID of the agents being queried. For example, this could map to "Ready," "Busy," or other custom statuses defined in the CallTools system.
-
ready=true:- A boolean flag indicating whether to filter for agents marked as "ready" (i.e., available for calls). Setting this to
falsewould return agents who are not ready.
- A boolean flag indicating whether to filter for agents marked as "ready" (i.e., available for calls). Setting this to
-
2. Authentication
To access the CallTools API, an Authorization header is required. Without this, the API call will fail.
Header Format
-
Key:
Authorization -
Value:
Token APIKEYHERE- Replace
APIKEYHEREwith the unique API key provided to your organization.
- Replace
3. Steps to Ping the System
Follow these steps to send a request to the CallTools API:
Step 1: Determine the API URL
- Confirm the base URL for your account (e.g.,
https://east-2.calltools.io). - Identify the appropriate
queueandagent_status_idvalues for your query.
Step 2: Set Up the API Request
- Choose a method to make the API call (e.g., Postman, Python script, or any HTTP client).
Step 3: Configure the Headers
- Add the
Authorizationheader with your API key:
Step 4: Build the Full URL
- Construct the full URL, including query parameters:
- Replace
<subdomain>with your assigned region. - Replace
<queue_id>and<status_id>with your specific values.
- Replace
Step 5: Send the Request
- Use an HTTP GET method to send the request.
- Example using
curl:
Step 6: Handle the Response
- The API will return a JSON object with agent statuses. For example:
- Parse the response to extract the information you need.
4. Testing and Error Handling
-
Test the API Key:
- Verify that your API key is valid and correctly added to the
Authorizationheader.
- Verify that your API key is valid and correctly added to the
-
Handle Common Errors:
- 401 Unauthorized: Check if the API key is correct and active.
- 404 Not Found: Verify the base URL and resource path.
- 400 Bad Request: Ensure all required query parameters are included.
-
Log Results:
- Log both successful and failed responses for debugging purposes.
5. Example Script (Python)
Here’s a simple Python script using the requests library:
Comments
0 comments
Article is closed for comments.