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 SDK
Microsoft Graph SDK
A Microsoft software developer kit designed to simplify building high-quality, efficient, and resilient applications that access Microsoft Graph.
741 questions
Microsoft Graph Cloud Communications API
Microsoft Graph Cloud Communications API
A Microsoft API that adds a new dimension to how your apps and services interact with users through various communications-related features, such as calling and online meetings.
123 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman-MSFT 4,486 Reputation points Microsoft Employee
    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.

    No comments