Question:

Access Denied Error when calling REST Call for specific user

Beau: 20 May 2022

I have created a script to fetch data from the list in SharePoint Online. To do so, there has been given a REST call to the list to fetch data. There is one user who is facing the issue that is shown in the screenshot.

enter image description here

https://<<siteCollection>>/_api/web/lists/getbytitle('FAQ')/items?$select=*,Function/Title,Region/Title&$expand=Function,Region

The issue comes for the one user only. Other users who has permission on the site are able to see the records as expected.

Any ideas?

Answer:
Logan: 20 May 2022

As mentioned in comments, based on the REST query that you have posted, you are using lookup columns.

So, you need to provide access to the lookup lists (could be named Function and Region) as well besides the FAQ list.

For that particular user or a SharePoint group, you can provide the minimum read permissions so that you can fetch data from those lists as well.

Summary - Just provide the basic read permissions on the 3 lists namely FAQ, Function and Region and you are good to go.