Salestrail provides Pull APIs that allow you to fetch call recordings, call logs, and other call-related data from your Salestrail dashboard. Below are the detailed steps to integrate and retrieve call recordings using the Pull API.
Step 1: Get API Access
Before you can start pulling call data, you need API credentials.
How to Get API Credentials:
Log in to your Salestrail account.
Go to API Settings (Check for "Developer" or "Integrations" section).
Generate API Key (You will need this key for authentication).
Check API Documentation (You will find details about available endpoints).
Step 2: Understand API Endpoints
Salestrail typically provides a GET request API endpoint to pull call data.
Sample API Endpoint for Call Recordings:
plaintextCopyEditGET https://api.salestrail.io/v1/calls
Example API Request:
bashCopyEditcurl -X GET "https://api.salestrail.io/v1/calls?recording=true" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
Query Parameters:
Parameter | Type | Description |
| boolean | Set to |
| string | Start date for call records (format: YYYY-MM-DD) |
| string | End date for call records (format: YYYY-MM-DD) |
| string | Fetch calls from a specific user (optional) |
| integer | Number of records to return per request |
Step 3: API Response Format
When you request call recordings, the API returns a JSON response that includes details of each call and a recording URL.
Example API Response:
jsonCopyEdit{ "status": "success", "data": [ { "call_id": "12345", "caller": "+1234567890", "receiver": "+0987654321", "call_type": "outgoing", "duration": 180, "timestamp": "2024-01-30T14:30:00Z", "recording_url": "https://salestrail.io/recordings/abcd1234.mp3" }, { "call_id": "12346", "caller": "+9876543210", "receiver": "+0123456789", "call_type": "incoming", "duration": 90, "timestamp": "2024-01-30T15:00:00Z", "recording_url": "https://salestrail.io/recordings/xyz5678.mp3" } ] }
Step 4: Download Call Recordings
To download a recording, follow these steps:
Extract the recording URL from the API response.
Use a script or manually download the file.
Example: Download via Python
pythonCopyEditimport requests # Replace with actual API key API_KEY = "YOUR_API_KEY" URL = "https://api.salestrail.io/v1/calls?recording=true" headers = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" } response = requests.get(URL, headers=headers) if response.status_code == 200: call_data = response.json() for call in call_data["data"]: recording_url = call["recording_url"] if recording_url: r = requests.get(recording_url) with open(f"recording_{call['call_id']}.mp3", "wb") as file: file.write(r.content) print(f"Downloaded: recording_{call['call_id']}.mp3") else: print("Failed to fetch call recordings:", response.status_code)
Step 5: Automate and Integrate with Your CRM
To automate recording retrieval and integrate with your CRM, follow these steps:
Schedule API Calls β Run the script at regular intervals to fetch new recordings.
Store Data Securely β Save recordings in a secure cloud storage or CRM system.
Attach Recordings to Leads/Contacts β If your CRM allows, map
caller_id
andreceiver
to existing records.Set Alerts for Missing Data β Monitor API responses to catch failures.
Step 6: Troubleshooting API Issues
Issue | Solution |
API returns | Check if the API key is valid and included in headers |
No recordings in response | Ensure that call recordings are enabled in Salestrail settings |
API returns | Salestrail API may have rate limits; try reducing request frequency |
| Ensure your account has permissions to access call recordings |