1

I am doing a GET request to below URL from POSTMAN to get Folder details and files. But i am always getting 404 Not Found in POSTMAN. ANy suggestion if the URL is wrong.

https://learningsfdc.sharepoint.com/sites/SidFirstSite/Shared%20Documents/_api/web/getfolderbyserverrelativeurl('/sites/SidFirstSite/Shared%20Documents')

Headers -

Accept -  application/json;odata=verbose
Authorization - Bearer + access_token

When i tried access the below URL i am able to access it and create files in it also.

URL i am able to access -

https://learningsfdc.sharepoint.com/_api/Web/GetFolderByServerRelativePath(decodedurl='/Shared%20Documents')/Files

URL i am unable to access folders is -

https://learningsfdc.sharepoint.com/sites/SidFirstSite/Shared%20Documents/_api/web/GetFolderByServerRelativeUrl(decodedurl='/sites/SidFirstSite/Shared%20Documents')/Files

What is the permission i am missing..

  • Please add headers you are using in your question. That will be helpful to answer your qustion maybe headers are causing this issue. – Ganesh Sanap Aug 5 at 9:58
  • added the headers in question. – learningmode Aug 5 at 10:05
  • i have updated my question with my few other findings.. – learningmode Aug 5 at 11:04
1

In Your URL you have added Shared%20Documents after site URL, which is not required.

Try using below URL:

https://learningsfdc.sharepoint.com/sites/SidFirstSite/_api/web/GetFolderByServerRelativeUrl('/Shared Documents')

Reference:

Working with folders and files with REST.

Also, you need to create the Site level app and add authorization to Postman. Check below article for this:

Access SharePoint Online using Postman.

  • I am getting..."Access denied. You do not have permission to perform this action or access this resource." – learningmode Aug 5 at 11:07
  • Try updated URL from answer and also check the article given in reference section. – Ganesh Sanap Aug 5 at 11:11
  • Have you registered Postman Authorization to SharePoint, here? – Ganesh Sanap Aug 5 at 11:22
  • No i haven't registered for POSTMAN..but registered for Salesforce..still i am able to access and create files for learningsfdc.sharepoint.com/Shared%20Documents/Forms/… .. not for Sites... – learningmode Aug 5 at 11:27
  • Try registering for postman as given in link and let me know if it works for you. – Ganesh Sanap Aug 5 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.