This maybe a long question, So, im trying to get share point list data from Postman tool using client id and client secret.
steps i did is,
step-1: in post man using client id, client secret, resource and accounts.accesscontrol.windows.net/7831e6d9-dc/tokens/OAuth/2? created access token successfully.
step-2: using that token in another tab postman, i hit ABC.sharepoint.com/sites/AuthorizationDev/_api/web/lists/getbytitle('DevelopmentList')/items, getting response as {
"d": {
"results": []
}
mean the empty array. but if i try to hit 'ABC.sharepoint.com/sites/AuthorizationDev/_api/web/lists/getbytitle('DevelopmentList')' , same URL without items parameter, i can see the 'ItemCount: 2'. Mean im having 2 items in the list. anything i have missed here? when i ask this question with ChatGPT, it saying
The issue you're facing, where you can see that the list has 2 items (ItemCount: 2) but the API returns an empty array when querying /_api/web/lists/getbytitle('DevelopmentList')/items, is often related to one of the following factors:
ItemCount: 2
/_api/web/lists/getbytitle('DevelopmentList')/items
1. Permissions
Even though you can access the list metadata (like item count), the user or app you're authenticating with might not have permission to read the items in the list. You need to ensure that:
To Check Permissions:
API Permissions:
Sites.Read.All
Sites.ReadWrite.All
so do i really need to change the permissions to read the list items through the URL?? Becz, i have watched many youtube tutorials, all providing the same steps which i followed above, But no one spoke about Azure permissions. pls. do the needful. Thanks.