Skip to main content
How to Pull Call Recordings from Salestrail Dashboard Using Pull APIs

Pull APIs

Yvonne Pulkkinen avatar
Written by Yvonne Pulkkinen
Updated over a week ago

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:

  1. Log in to your Salestrail account.

  2. Go to API Settings (Check for "Developer" or "Integrations" section).

  3. Generate API Key (You will need this key for authentication).

  4. 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

recording

boolean

Set to true to fetch only calls with recordings

from_date

string

Start date for call records (format: YYYY-MM-DD)

to_date

string

End date for call records (format: YYYY-MM-DD)

caller_id

string

Fetch calls from a specific user (optional)

limit

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:

  1. Extract the recording URL from the API response.

  2. 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:

  1. Schedule API Calls – Run the script at regular intervals to fetch new recordings.

  2. Store Data Securely – Save recordings in a secure cloud storage or CRM system.

  3. Attach Recordings to Leads/Contacts – If your CRM allows, map caller_id and receiver to existing records.

  4. Set Alerts for Missing Data – Monitor API responses to catch failures.


Step 6: Troubleshooting API Issues

Issue

Solution

API returns 401 Unauthorized

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 429 Too Many Requests

Salestrail API may have rate limits; try reducing request frequency

recording_url not accessible

Ensure your account has permissions to access call recordings


Did this answer your question?