0

URL = https://uk.sharepoint.com/sites/CKnowledge/Guard/Forms/AllItems.aspx

I can GET this URL on MS Graph using:

https://graph.microsoft.com/v1.0/sites/uk.sharepoint.com:/sites/CKnowledge:/lists/%7B00000000-0000--0000-0000-000000000000%7D

But I can't seem to GET this URL on MS Graph:

https://uk.sharepoint.com/sites/CKnowledge/Guard/Forms/AllItems.aspx?viewid=848cf2f9-0ece-4f16-a9e9-fbdef773655c

MazePatz
  • 1
  • 1
  • Does this view have any filtering in it? If so, you would have to recreate the same $filter in your Graph API call when using the list drive items method. Alternatively, you could look into using the older REST API endpoints. It should be possible to use a CAML query/xml for this: https://stackoverflow.com/questions/26884647/using-rest-to-fetch-sharepoint-view-items – Expiscornovus Apr 24 '23 at 15:47

1 Answers1

0

Please try follow below 2 steps to get items in a document library or list:

  1. Using /sites/{site-id}/drives/{drive-id}/items/root/children or /sites/{site-id}/lists/{list-id}/items to get the item id of the target folder, file or list.

  2. Get the target content by /sites/{site-id}/drives/{drive-id}/items/{item-id} or /sites/{site-id}/lists/{list-id}/items/{item-id}

Hope this helps. Best Wishes.

Zehui Yao
  • 87
  • 4