Forum Discussion

dataSights_MDI's avatar
dataSights_MDI
Copper Contributor
Nov 15, 2022

Getting -2147024891, System.UnauthorizedAccessException - Sharepoint Online Rest API

We are fetching Sharepoint list through REST API for a client (tenant domain is medicaldesigninnovations), for that

  1. We have registered an app here https://medicaldesigninnovations.sharepoint.com/_layouts/15/appregnew.aspx 
  2. Getting access/bearer token here https://accounts.accesscontrol.windows.net/48d0888c-0094-4141-ba64-11904884303b/OAuth/2
  3. Passing the bearer token to fetch a list called 'Project List' here https://medicaldesigninnovations.sharepoint.com/sites/projects/_api/web/lists/getbytitle('Project List')/items but getting the below error, response status is 403 Forbidden

{

    "error": {

        "code": "-2147024891, System.UnauthorizedAccessException",

        "message": {

            "lang": "en-US",

            "value": "Attempted to perform an unauthorized operation."

        }

    }

}

1 Reply

  • rajkumar50's avatar
    rajkumar50
    Copper Contributor
    I am also doing same steps and facing the same error.

    {
    "error": {
    "code": "-2147024891, System.UnauthorizedAccessException",
    "message": {
    "lang": "en-US",
    "value": "Attempted to perform an unauthorized operation."
    }
    }
    }

    Please Help!

Resources