How to retrieve all PstnCall records for a given time period using Graph SDK

Barrel 0 Reputation points

I have tried to retrieve all records for a given time period with the following code.
However, since the type is "CallRecord" instead of "ICloudCommonCallRecordsCollectionPage", I cannot get all the records as in "result.NextPageRequest.GetAsync();".

var result = graphClient.Communications.CallRecords[$"getPstnCalls(fromDateTime={fromDateTime},toDateTime={toDateTime})"]

How can I get it using the Graph SDK?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,573 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 5,946 Reputation points

    Hi @Barrel

    As per the documentation, the @odata.NextLink will not appear in response if count is less then 1000 entries within provided date range.

    If there are more than 1000 entries in the date range, the body also includes an @odata.NextLink with a URL to query the next page of call entries. The last page in the date range does not have @odata.NextLink. For more information, see paging Microsoft Graph data in your app.

    You can also refer to this example.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments