Why there is only 10 records i am getting when using List events?

Utkarsh Prashar 40 Reputation points
2024-03-22T16:04:38.1833333+00:00

Hello team we are using this api but its shows only 10 records in a single run although we have multiple records.

res = invokeurl

[

url :"https://graph.microsoft.com/v1.0/me/events"

type :GET

headers:header_map

];

Can anyone help on this on priority?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 46,376 Reputation points
    2024-03-25T02:36:00.38+00:00

    Hi @Utkarsh Prashar

    Try the API endpoint below, this will return 200 items per page and count your event object set.

    https://graph.microsoft.com/v1.0/me/events?$top=200&$count=true
    

    Hope this helps.

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

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. AsithwMSFT 1,520 Reputation points Microsoft External Staff
    2024-03-22T18:39:19.73+00:00

    @Utkarsh Prashar

    This happens because of paging. by default event api return first 10 events .If there are more events, the Graph API includes a property called ‘@odata.nextLink’. This property contains a URL to access the next page.

    use this "@odata.nextLink" to get remaining events until it doesn't have value.

    "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/events?%24top=10&%24skip=10"
    

    image

    find more about paging.

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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.