Can Graph API get all shared items once or by paging?

Henry Jia 21 Reputation points
2023-04-13T08:54:38.1+00:00

When using https://graph.microsoft.com/v1.0/me/drive/sharedWithMe , only top 200 items are returned even there has more than 200 items, using $top can control the size but it's not we expected since it can't ensure that all items returned if more items present, also we need consider the payload size / network transfer time (time out or long time to get the response etc.) if too large value is used. It seems that $skip, $count is not supported for this API since the response as following for $skip usage

{
    "error": {
        "code": "invalidRequest",
        "message": "$skip is not supported on this API. Only URLs returned by the API can be used to page.",
        "innerError": {
            "date": "2023-04-13T08:21:48",
            "request-id": "2d01be9c-aff2-4e2c-811f-8a642001dc20",
            "client-request-id": "cd2727bd-f4f9-f200-c753-852fd6f82849"
        }
    }
}

So we want to know, if there has any flag (query parameter) to get all items once or something else which like other API support paging by using @odata.nextLink in response? A similar question found but without solution: https://learn.microsoft.com/en-us/answers/questions/428935/graph-endpoint-me-drive-sharedwithme-is-not-pagina Thanks in advance!

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

Accepted answer
  1. CharanyaB-MSFT 1,891 Reputation points
    2023-04-13T14:29:43.58+00:00

    Hello @Henry Jia,

    Thanks for reaching out!

    I am able to reproduce your issue locally, and it seems to be a bug, as the @odata.nextLink is not available in the response for this API.

    Since, this seems to be a bug, I would recommend you report this bug by raising a support case with Microsoft, a dedicated Support Engineer will be able to assist you better. You can raise support ticket from http://aad.portal.azure.comor https://admin.microsoft.com/#/support/requests.

    Hope this helps.

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

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.