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

Barrel 0 Reputation points
2023-01-13T06:20:50.03+00:00

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})"]
    .Request()
    .GetAsync().Result;

How can I get it using the Graph SDK?
Thanks!

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

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 5,946 Reputation points
    2023-01-31T17:27:40.3633333+00:00

    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