D365: “Access denied. You do not have permission to perform this action or access this resource” while calling SharePoint API from plugin/custom workflow

Recently, we were working on calling SharePoint API from plugin. While getting the access token we received the following error: “Access denied. You do not have permission to perform this action or access this resource”.

To fix this issue, we gave appropriate permission to the Application we had created in SharePoint for Server to Server authentication.

Below is the permission XML:

<AppPermissionRequests AllowAppOnlyPolicy="true">
  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl"/>
</AppPermissionRequests>

We can follow the steps mentioned here to give the above permission.

Hope it helps !!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.