HomeVICIdial TutorialsVICIdial Non Agent API TutorialsRetrieving All Information for a Lead with lead_all_info API

Retrieving All Information for a Lead with lead_all_info API

Key Takeaways

The lead_all_info API in VICIdial is a powerful tool that retrieves complete lead details, including personal information, contact data, campaign assignments, call history, and custom fields. This function is essential for CRM integrations, agent dashboards, and automated reporting, ensuring that all lead-related data is easily accessible in a single API request.

To use this API, the requesting user must have API access enabled and the necessary permissions assigned within VICIdial. The user account should have a User Level of 7 or higher and explicit access to the lead_all_info function (or full API access). Without these permissions, the API request will be rejected, preventing access to lead details.

The API request can be executed using a web browser, cURL (command-line tool), or Postman (API testing tool), making it flexible for different development environments. Whether retrieving lead data for a single lead or integrating VICIdial with external platforms, this API ensures seamless access to all relevant lead information.

However, common errors, such as insufficient permissions or incorrect input parameters, can prevent successful data retrieval. Most issues can be resolved by verifying user permissions in the VICIdial Admin Panel and ensuring that the lead ID exists in the system. Proper error handling and validation will help maintain smooth API functionality and prevent disruptions in data retrieval workflows.

VICIdial is a powerful open-source call center solution that provides extensive lead management capabilities. One of the most useful API functions for retrieving lead details is the lead_all_info API.

This API function allows you to fetch complete lead data from the VICIdial system, including personal details, contact information, call history, custom fields, and status updates.

Why Use the lead_all_info API?

Retrieve detailed lead information for CRM integration
Access all available lead data in a single API call
Improve agent workflows by displaying complete lead history
Automate lead verification and auditing processes
Extract data for reporting and analytics

In this tutorial, we’ll cover:

  • How the lead_all_info API works
  • Prerequisites for using the API
  • How to construct and send API requests
  • Example API calls using a browser, cURL, and Postman
  • Understanding API responses and handling errors
  • Best practices for retrieving and using lead data

Let’s get started! 🚀


Understanding the lead_all_info API Function

The lead_all_info API retrieves all available data for a given lead, including:

Basic Lead Information (Name, Phone Number, Email, Address)
Call and Campaign History (Status, Last Call Date, Callbacks)
Custom Fields (Any additional fields created in VICIdial)
Lead Assignment Details (Campaign, Agent, List ID)

Common Use Cases for lead_all_info API

🔹 CRM Integrations – Sync lead data with third-party platforms
🔹 Agent Dashboards – Display lead history before calls
🔹 Lead Verification – Ensure lead details are accurate
🔹 Data Exports – Extract lead data for reporting and analytics


Step 1: Prerequisites for Using the API

Before using the lead_all_info API, ensure you have:

VICIdial installed and configured
An API-enabled user account with appropriate permissions
A valid lead ID (existing lead in VICIdial)
VICIdial server access credentials

How to Enable API Access in VICIdial

1️⃣ Log in to the VICIdial Admin Panel
2️⃣ Navigate to Admin > Users
3️⃣ Select the user who will access the API
4️⃣ Set API Access to 1 (Enabled)
5️⃣ Set User Level to 7 or higher
6️⃣ Add lead_all_info to the Allowed API Functions (or set to ALL)
7️⃣ Click Save Changes

Now, your user is authorized to retrieve lead details using the API.


Step 2: Constructing the API Request

The VICIdial API uses HTTP GET requests, meaning you can access it via a browser, cURL, or API tools like Postman.

Base API URL

arduino
http://your-vicidial-server/vicidial/non_agent_api.php

🔹 Replace your-vicidial-server with your actual VICIdial instance.

Required Parameters for lead_all_info API

Parameter Description Example
function Specifies the API function (lead_all_info) lead_all_info
user VICIdial API username admin
pass VICIdial API password 1234
source Identifier for tracking API calls CRM_Query
lead_id Unique ID of the lead to retrieve 1001

Step 3: Sending the API Request

Method 1: Retrieving Lead Information via a Web Browser

Simply enter the following URL in your browser (replace credentials accordingly):

pgsql
http://your-vicidial-server/vicidial/non_agent_api.php?function=lead_all_info&user=admin&pass=1234&source=CRM_Query&lead_id=1001

🔹 Press Enter, and the lead details should display in your browser.


Method 2: Retrieving Lead Information via cURL (Command Line)

For developers, cURL is a convenient tool for making API requests. Use the following command:

bash
curl -X GET "http://your-vicidial-server/vicidial/non_agent_api.php?function=lead_all_info&user=admin&pass=1234&source=CRM_Query&lead_id=1001"

🔹 This will return the lead information directly in the terminal.


Method 3: Retrieving Lead Information via Postman

1️⃣ Open Postman
2️⃣ Set the request type to GET
3️⃣ Enter the API URL
4️⃣ Click Send
5️⃣ View the API response in the output panel


Step 4: Understanding API Responses

If the request is successful, VICIdial returns a response with complete lead details in a pipe-separated format (|):

ruby
1001|John|Doe|9876543210|johndoe@example.com|123 Main St|NY|USA|SALE|2024-01-15|CALLBACK|Agent123|Campaign1|CustomField1:Value1|CustomField2:Value2

Breaking Down the Response

Value Meaning
1001 Lead ID
John First Name
Doe Last Name
9876543210 Phone Number
johndoe@example.com Email
123 Main St Address
NY State
USA Country
SALE Lead Status
2024-01-15 Last Call Date
CALLBACK Lead Callback Status
Agent123 Assigned Agent
Campaign1 Campaign Name
CustomField1:Value1 Custom field data

Step 5: Handling Errors & Troubleshooting

If something goes wrong, VICIdial will return an error message instead of lead details.

Common Errors & Fixes

Error Message Cause Solution
ERROR: USER DOES NOT HAVE PERMISSION TO USE THIS FUNCTION Insufficient API permissions Ensure user level is 7+ and API Access is enabled
ERROR: INVALID USERNAME OR PASSWORD Wrong credentials Verify API username and password
ERROR: NO FUNCTION SPECIFIED Missing function parameter Ensure function=lead_all_info is included
ERROR: LEAD NOT FOUND Invalid lead ID Verify that the lead_id exists in VICIdial

Step 6: Best Practices for Using the lead_all_info API

Validate lead ID before requesting data to avoid unnecessary queries
Use API responses to populate agent dashboards for better lead handling
Store retrieved data in a structured format (JSON, database, etc.)
Monitor API logs to detect errors and optimize data retrieval processes
Ensure data security by restricting access to sensitive lead information


Conclusion

The lead_all_info API function is an essential tool for retrieving complete lead details in VICIdial. Whether you’re integrating with a CRM, displaying lead data for agents, or extracting records for analytics, this API provides all the necessary information in a single request.

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Special Offerspot_img

Must Read

spot_img
spot_img
spot_img

Related Articles - Must Read

spot_img