Sharepoint API Unauthorized Operation

Alves, Andre 40 Reputation points
2023-09-15T07:54:45.92+00:00
Hi Experts,

I'm having the error below when invoking the SharePoint API via Postman.

Request URL:

https://<site_domain>/_api/web/GetFolderByServerRelativeUrl('/teams/SuccessFactorPhotoIntegration/Shared%20Documents/Photo')/Files

<?xml version="1.0" encoding="utf-8"?>

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

    <m:code>-2147024891, System.UnauthorizedAccessException</m:code>

    <m:message xml:lang="en-US">Attempted to perform an unauthorized operation.</m:message>

</m:error>

Any suggestion on have to overcome this issue?

Thank you.
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,679 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 35,386 Reputation points Microsoft Vendor
    2023-09-15T09:05:43.4733333+00:00

    Hi @Alves, Andre,

    As the error message shows, this is a permission error. I will recommend you to register SharePoint App only to grant access. Here is a nice article about register sharepoint app only and get accesstoken in postman.

    https://anoopt.medium.com/accessing-sharepoint-data-using-postman-sharepoint-rest-api-76b70630bcbf


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.