Using Gong's calls API, any way to sort results by date descending? Meaning getting the most recently recorded calls first.

  • 17 March 2023
  • 5 replies


We are using the calls API to get the Gong calls for our customers, but that endpoint returns results from the earliest recorded calls to the latest. Meaning we have to paginate all the way to the end, which can be a lot, to get to the latest calls. Is there any for that endpoint to give us the data in the reverse order? with the latest calls coming first. Thanks! 

5 replies

Userlevel 5
Badge +3

Use the fromDateTime and ToDateTime in the /v2/calls to restrict the calls to the most recent. That way you won’t have to page through the cursor as much / at all. 


Userlevel 6
Badge +1

Thank you @Andrew O'Driscoll our Salesforce expert!

@Marcos Nery please let me know if this was helpful!


Thank you @Molly Kipnis, thank you @Andrew O'Driscoll 

However, we won't know if for a given customer the latest call was last week, or two months ago. So that won't filter much for us. Specially given that the most recent calls will be at the end of the pagination, since there's no way to sort them from most recent to oldest. 

Is there any other API feature that could help us with that? Thanks! 

Userlevel 5
Badge +3

@Marcos Nery that helps. 

The API, as you can see, does not allow for additional constraints beyond dates/ time. 


Idea, if 

  1. you are using Gong for Salesforce AND
  2. your code has visibility to a SFDC Account/ opportunity/ contact id

you could query Salesforce, using their API, to get the latest call for that given account (use the Gong ID field), or even get all the most recent Gong Call ids.  

This opens up a lot of possibilities.

Get the call date for the most recent call (since you can do a sort in your SFDC query)

Potentially get all the most recent calls and pass this list into the callIds parameter of the /v2/calls/extensive method. 


Have fun. Let us know what you do. 



Thanks @Andrew O'Driscoll ! Really helpful. 

I do indeed have access to the Salesforce data. But, as I understand, there's no guarantee that every customer will have the Gong call id on the opportunity. Only those who use the Gong app for salesforce as you mentioned. 

While for the others, the Salesforce Opportunity Id will be associated here at Gong, but the Gong call id won't appear at Salesforce, right?