I want to get external list items, but I get 403 Access denied.
I have an external list in my site. According to documentation https://learn.microsoft.com/en-us/sharepoint/dev/general-development/bcs-rest-api-reference-for-sharepoint I can work with an external list like with normal lists.
I can easily fetch the list information by using REST API endpoint:
https://{site}.sharepoint.com/sites/{site}/_api/Web/Lists(guid'{list-id}')
However, when I try to get list items by using the next endpoint:
https://{site}.sharepoint.com/sites/{site}/_api/Web/Lists(guid'{list-id}')/Items
I get:
403 Forbidden
{
"odata.error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": {
"lang": "en-US",
"value": "Access denied. You do not have permission to perform this action or access this resource."
}
}
}
But when I put this url
https://{site}.sharepoint.com/sites/{site}/_api/Web/Lists(guid'{list-id}')/Items
in my browser, it returns me all the items.
For authorization I use an Access token, but in browser they send cookies.
Can someone explain me what the difference between the permissions that are set on cookies and access tokens and if there is an other way to fetch data from an external list?