web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Getting 403 Forbidden error when trying to connect to Dataverse or Power Automate Web API (CDS)

(0) ShareShare
ReportReport
Posted on by 5

Hi,

We are trying to use the Power Automate Web API by connecting to "https://*****.crm.dynamics.com/" ( where ***** is the environment URL retrieved from the power platform admin center) using the token generated using MSAL. The access or the bearer token is created just fine by using the client ID of our custom registered app but when this same token is passed to connect to https://*****.crm.dynamics.com/" ( i.e set scope as https://*****.crm.dynamics.com/.default) ,  to retrieve the flow definitions (client_data), we are running into 403 Forbidden error. Please see the code snippet below -- The error 403 is thrown on line where GetAsync method is called.

private string GetMasterFlowClientData(string resource, string accessToken, string FlowName)
{
try
{
using (var client = new HttpClient())
{
client.BaseAddress = new Uri(resource   "/api/data/v9.1/");
client.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", accessToken);
client.Timeout = new TimeSpan(0, 2, 0);
client.DefaultRequestHeaders.Add("OData-MaxVersion", "4.0");
client.DefaultRequestHeaders.Add("OData-Version", "4.0");
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var response = client.GetAsync(string.Format("workflows?$filter=name eq '{0}'", FlowName)).Result;
if (response.IsSuccessStatusCode)
{
 //..
 }

How do we connect to https://*****.crm.dynamics.com/ using the access token generated using MSAL? 

Is it possible to give permissions to an app in Azure from Dynamics 365? or should we have to add https://*****.crm.dynamics.com/  into the app registrations in Azure?

How can we make our app communicate successfully with https://*****.crm.dynamics.com/ where our flows are stored? 

 Any help is greatly appreciated. Thank you in advance.

Regards

SLS

I have the same question (0)
  • Suggested answer
    PabloCRP Profile Picture
    1,088 on at

    Hi, seems like some roles are missing to your application user.

    validate that the user's role use has process turned on this if for workflows and flows

    pastedimage1622244162636v1.png

    regards.

  • Suggested answer
    Viswanath Profile Picture
    93 on at

    Thanks Roldan,

    Above one worked.

  • Gawain Profile Picture
    5 on at

    Hi,Pablo

    I'm a newbie and I'm having the same problem, I'm wondering if there are any permissions that can be added inside the app to fix this error?

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans