Class: Leash::Integration::GongClient
- Inherits:
-
Object
- Object
- Leash::Integration::GongClient
- Defined in:
- lib/leash/integration/gong.rb
Instance Method Summary collapse
-
#get_call(callid) ⇒ Object
Get metadata for a specific Gong call including URL, direction, scope, system, and duration.
-
#get_call_summary(callid) ⇒ Object
Get an AI-generated summary of a single call including brief overview, key points, topics, action items, and detailed outline.
-
#get_call_transcript(callid, maxlength: nil, offset: nil) ⇒ Object
Get the raw transcript for a single call with speaker-attributed text.
-
#get_library_folder_calls(folderid) ⇒ Object
Get all calls saved in a specific Gong library folder.
-
#get_trackers(workspaceid: nil) ⇒ Object
List all keyword tracker definitions including tracked phrases, affiliation (who speaks them), and filter queries.
-
#get_user(userid) ⇒ Object
Get a specific user profile including name, email, title, phone, and settings.
-
#initialize(leash) ⇒ GongClient
constructor
Create a new Gong integration client.
-
#list_calls(fromdatetime: nil, todatetime: nil, workspaceid: nil, cursor: nil) ⇒ Object
List Gong calls with optional date filtering.
-
#list_library_folders(workspaceid) ⇒ Object
List all public Gong call library folders for a workspace.
-
#list_users(cursor: nil, includeavatars: nil) ⇒ Object
List all Gong users in your workspace.
-
#list_workspaces ⇒ Object
List all Gong workspaces with their IDs and names.
-
#search_calls(fromdatetime: nil, todatetime: nil, workspaceid: nil, primaryuserids: nil, callids: nil, cursor: nil) ⇒ Object
Search for Gong calls with advanced filters including date range, workspace, primary users (call hosts), and specific call IDs.
-
#search_users(userids: nil, createdfromdatetime: nil, createdtodatetime: nil, cursor: nil) ⇒ Object
Search and filter users by IDs or creation date.
Constructor Details
#initialize(leash) ⇒ GongClient
Create a new Gong integration client.
11 12 13 |
# File 'lib/leash/integration/gong.rb', line 11 def initialize(leash) @leash = leash end |
Instance Method Details
#get_call(callid) ⇒ Object
Get metadata for a specific Gong call including URL, direction, scope, system, and duration. Faster than get_call_summary when you only need call metadata.
96 97 98 99 100 101 |
# File 'lib/leash/integration/gong.rb', line 96 def get_call(callid) params = { 'callId' => callid }.compact @leash.call('gong', 'get_call', params) end |
#get_call_summary(callid) ⇒ Object
Get an AI-generated summary of a single call including brief overview, key points, topics, action items, and detailed outline. This is the recommended way to understand a call - use get_call_transc…
36 37 38 39 40 41 |
# File 'lib/leash/integration/gong.rb', line 36 def get_call_summary(callid) params = { 'callId' => callid }.compact @leash.call('gong', 'get_call_summary', params) end |
#get_call_transcript(callid, maxlength: nil, offset: nil) ⇒ Object
Get the raw transcript for a single call with speaker-attributed text. Only use this when you need exact quotes - prefer get_call_summary for understanding call content. Transcripts are truncated b…
49 50 51 52 53 54 55 56 |
# File 'lib/leash/integration/gong.rb', line 49 def get_call_transcript(callid, maxlength: nil, offset: nil) params = { 'callId' => callid, 'maxLength' => maxlength, 'offset' => offset }.compact @leash.call('gong', 'get_call_transcript', params) end |
#get_library_folder_calls(folderid) ⇒ Object
Get all calls saved in a specific Gong library folder. Returns call IDs, titles, curator notes, and snippet timing. Use list_library_folders to find folder IDs. Call IDs can be passed to get_call_s…
165 166 167 168 169 170 |
# File 'lib/leash/integration/gong.rb', line 165 def get_library_folder_calls(folderid) params = { 'folderId' => folderid }.compact @leash.call('gong', 'get_library_folder_calls', params) end |
#get_trackers(workspaceid: nil) ⇒ Object
List all keyword tracker definitions including tracked phrases, affiliation (who speaks them), and filter queries. Explains tracker hits visible in call summaries.
107 108 109 110 111 112 |
# File 'lib/leash/integration/gong.rb', line 107 def get_trackers(workspaceid: nil) params = { 'workspaceId' => workspaceid }.compact @leash.call('gong', 'get_trackers', params) end |
#get_user(userid) ⇒ Object
Get a specific user profile including name, email, title, phone, and settings. Use to resolve user IDs returned from call data.
118 119 120 121 122 123 |
# File 'lib/leash/integration/gong.rb', line 118 def get_user(userid) params = { 'userId' => userid }.compact @leash.call('gong', 'get_user', params) end |
#list_calls(fromdatetime: nil, todatetime: nil, workspaceid: nil, cursor: nil) ⇒ Object
List Gong calls with optional date filtering. Returns minimal call metadata (ID, title, date, duration). Use get_call_summary for details or get_call_transcript for full transcript.
22 23 24 25 26 27 28 29 30 |
# File 'lib/leash/integration/gong.rb', line 22 def list_calls(fromdatetime: nil, todatetime: nil, workspaceid: nil, cursor: nil) params = { 'fromDateTime' => fromdatetime, 'toDateTime' => todatetime, 'workspaceId' => workspaceid, 'cursor' => cursor }.compact @leash.call('gong', 'list_calls', params) end |
#list_library_folders(workspaceid) ⇒ Object
List all public Gong call library folders for a workspace. Returns folder IDs and names to use with get_library_folder_calls. Use list_workspaces to find workspace IDs.
154 155 156 157 158 159 |
# File 'lib/leash/integration/gong.rb', line 154 def list_library_folders(workspaceid) params = { 'workspaceId' => workspaceid }.compact @leash.call('gong', 'list_library_folders', params) end |
#list_users(cursor: nil, includeavatars: nil) ⇒ Object
List all Gong users in your workspace. Returns user details including name, email, and title.
63 64 65 66 67 68 69 |
# File 'lib/leash/integration/gong.rb', line 63 def list_users(cursor: nil, includeavatars: nil) params = { 'cursor' => cursor, 'includeAvatars' => includeavatars }.compact @leash.call('gong', 'list_users', params) end |
#list_workspaces ⇒ Object
List all Gong workspaces with their IDs and names. Use workspace IDs as filters in list_calls, search_calls, get_trackers, and other tools.
145 146 147 148 |
# File 'lib/leash/integration/gong.rb', line 145 def list_workspaces params = {} @leash.call('gong', 'list_workspaces', params) end |
#search_calls(fromdatetime: nil, todatetime: nil, workspaceid: nil, primaryuserids: nil, callids: nil, cursor: nil) ⇒ Object
Search for Gong calls with advanced filters including date range, workspace, primary users (call hosts), and specific call IDs. More flexible than list_calls for targeted queries.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/leash/integration/gong.rb', line 80 def search_calls(fromdatetime: nil, todatetime: nil, workspaceid: nil, primaryuserids: nil, callids: nil, cursor: nil) params = { 'fromDateTime' => fromdatetime, 'toDateTime' => todatetime, 'workspaceId' => workspaceid, 'primaryUserIds' => primaryuserids, 'callIds' => callids, 'cursor' => cursor }.compact @leash.call('gong', 'search_calls', params) end |
#search_users(userids: nil, createdfromdatetime: nil, createdtodatetime: nil, cursor: nil) ⇒ Object
Search and filter users by IDs or creation date. More flexible than list_users for resolving specific user IDs from call data.
132 133 134 135 136 137 138 139 140 |
# File 'lib/leash/integration/gong.rb', line 132 def search_users(userids: nil, createdfromdatetime: nil, createdtodatetime: nil, cursor: nil) params = { 'userIds' => userids, 'createdFromDateTime' => createdfromdatetime, 'createdToDateTime' => createdtodatetime, 'cursor' => cursor }.compact @leash.call('gong', 'search_users', params) end |