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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 107 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 94

#3
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans