How to Identify correct URL pattern of SharePoint to get list of items by title from Rest API

sharepoint.stackexchange https://sharepoint.stackexchange.com/questions/250370

  •  24-01-2021
  •  | 
  •  

문제

My goal is to get all items or files names at this URL

https://myOrganization.sharepoint.com/sites/supplierABC/DataSheet/Forms/AllItems.aspx

I have followed this link and I already have client Id and client secret for the SharePoint URL by using them I am able to generate access token successfully. By using generated access token in Authorization (Postman header), I am trying a get request in Postman with URLs:

https://myOrganization.sharepoint.com/_api/web/lists/getbytitle('test')/items https://myOrganization.sharepoint.com/sites/supplierABC/DataSheet/Forms/AllItem.aspx/_api/web/lists/getbytitle('test')/items

My question here is which URL should be used before _api/web/lists/getbytitle('test')/items either

  1. https://myOrganization.sharepoint.com
    or
  2. https://myOrganization.sharepoint.com/sites/supplierABC/DataSheet/Forms/AllItems.aspx (files are present here)
도움이 되었습니까?

해결책

Your REST URL should be:

_spPageContextInfo.webServerRelativeUrl + _api/web/lists/getbytitle('test')/items
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top