A Node.js application to export company data from Gong.io via their API.
- Export call and conversation data (metadata, transcripts, recordings) using
/v2/calls/extensiveendpoint - Export user and team information using
/v2/usersendpoint - Export CRM and Engage data (when available)
- Export analytics and reporting data (when available)
- Logs information about call recording videos (MP4 files) from meeting URLs
- Note on Video Access: The system attempts to download videos from Amazon S3 URLs, but these are typically access-restricted
- A list of videos that need specific access is saved to
failed_video_downloads_*.json
- Robust error handling and rate limiting for API calls (3 calls/sec, 10,000 calls/day)
- Saves exports to JSON files in the
exports/directory - Contains infrastructure for video downloads in
exports/videos/directory
Note: If the API endpoints have changed since development, the endpoints can be updated in the
src/api/gongExport.jsfile.
- Node.js (LTS version recommended)
- Gong.io API key and access
According to Gong Support, the S3 URLs in the call metadata are not meant to be accessed directly. Gong protects recordings with time-limited, signed URLs to ensure secure access.
How We Download Videos:
This application uses two methods to obtain video URLs from Gong's API:
Primary Method: Uses the /v2/calls/extensive endpoint (POST) which returns call data including embedded video URLs in the media.videoUrl field.
Fallback Method: Uses the /v2/calls/{callId}/media endpoint (PUT) to generate signed URLs for individual calls when the extensive endpoint doesn't provide video URLs.
The application tries different HTTP methods (PUT with various content types, DELETE) to accommodate different Gong API configurations.
The application automatically:
- Fetches call data from the
/v2/calls/extensiveendpoint with embedded video URLs - For calls without embedded URLs, requests signed URLs from
/v2/calls/{callId}/media - Downloads the media using the obtained URLs (which may be time-limited)
- Saves the videos to the
exports/videos/directory
If any videos fail to download, details will be saved in a failed_video_downloads_*.json file for reference.
Troubleshooting Video Access:
The Gong API can have different configurations for accessing media files. If you're experiencing issues:
-
Disable Video Downloads: Video downloads are disabled by default (since you've been having issues).
- To enable: Edit
src/export.jsand changeenableVideoDownloads = falsetotrue
- To enable: Edit
-
Check API Permissions: Your Gong API credentials might need specific permissions for media access.
- Contact your Gong administrator to ensure your credentials have the necessary permissions
-
API Method Limitations: Your Gong instance may not support the standard API methods for downloading media.
- In this case, use the Gong web interface to access videos
The export of call metadata and user data will work regardless of video download capabilities.
-
Clone this repository:
git clone <repository-url> cd gongexport -
Install dependencies:
npm install -
Create a
.envfile in the project root with your Gong.io API credentials:cp .env.example .envThen edit the
.envfile to add your Gong.io API key and URL.
Run the export process directly:
npm run export
Or use the trigger script:
npm run trigger
You can also use the export functionality in your own code:
const exportGongData = require('./src/export');
exportGongData()
.then(data => {
console.log('Export successful:', Object.keys(data));
})
.catch(error => {
console.error('Export failed:', error);
});/src: Source code/api: API integration with Gong.io/config: Configuration management/utils: Utility functions (logging, etc.)
/logs: Log files
Logs are stored in the /logs directory:
error.log: Error-level logscombined.log: All logs (info, warn, error)
ISC