Hello @Riyaz Budhwani ,
Thanks for the ask and using Microsoft Q&A platform .
As we understand the ask here is for a resolution to the above error . Please do let me know if that not accurate
To me it looks that the the application ID which you have created in Step#1 does not have the the required permission and so you are getting the error .
I request you to please revist the Step #2 of this document
Step #2
Grant SharePoint Online site permission to your registered application:
Note
This operation requires SharePoint Online site owner permission. You can find the owner by going to the site home page -> click the "X members" in the right corner -> check who has the "Owner" role.
Open SharePoint Online site link e.g. https://[your_site_url]/_layouts/15/appinv.aspx (replace the site URL).
Search the application ID you registered, fill the empty fields, and click "Create".
App Domain: localhost.com
Redirect URL: https://www.localhost.com
Permission Request XML:
XML
Copy
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="Read"/>
</AppPermissionRequests>
sharepoint grant permission
Click "Trust It" for this app.
Please do let me if you have any queries .
Thanks
Himanshu
-------------------------------------------------------------------------------------------------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators