Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4790

Cannot Retrieve SharePoint Online List via REST API – Bearer Token Issue

$
0
0

I am trying to retrieve data from a SharePoint Online list using a REST API call, but I am encountering an issue. Here is the code and request structure I am using:

GET https://companyname.sharepoint.com/_api/web/getbytitle('listname')  Authorization: "Bearer " + accessToken  Accept: "application/json;odata=verbose"

I keep getting an error when making the request. However, the bearer token seems to be correctly generated, as I can retrieve it without any issues.

enter image description here

I have set up permissions in Azure AD (Entra ID), and the application has the necessary API permissions.The token is generated via the Client Credentials flow.The request is sent using Postman (or another HTTP client/tool).

enter image description here

What could be causing this issue? Am I missing any specific permissions or headers required by SharePoint Online? Do I need to adjust the request format?

Any insights or guidance would be greatly appreciated!

enter image description here


Viewing all articles
Browse latest Browse all 4790

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>