cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pabloglombo
Level: Powered On

I cannot work with Flow REST API

I am trying to create a new flow programmatically using the "Power Automate Web API":

https://docs.microsoft.com/en-us/flow/web-api

 

I am stuck at composing the HTTP request, particularly when getting the organization ID.

One person said that I should get the organization id using this way:

https://social.msdn.microsoft.com/Forums/en-US/b7054ea4-29b7-414e-8141-73480f37c6eb/using-microsoft-...

 

However like I said in that explanation, it did not work OK for me.

 

In my case for example my user is pablo@mycompanycenter.com  and in the enviroments part, the default organization is for example "My company.something".

 

Before creating a flow I am trying with this basic request:

https://ORGANIZATIONID.REGION.dynamics.com/api/data/v9.1/workflows

 

So I tried using (using this example)

https://mycompanycenter.com.crm4.dynamics.com/api/data/v9.1/workflows

but in C# I get  "The remote name could not be resolved"

I tried with:

https://My company.something.crm4.dynamics.com/api/data/v9.1/workflows

or

https://My%20company.something.crm4.dynamics.com/api/data/v9.1/workflows

but in this case the HttpWebRequest.Create method raises an exception because of the space in the domain name.

 

So here I am trapped... I have access to another organization and with that other organization it works fine... if I use the same code I get the error 401 (unauthorized) that is OK because I am not using the good ID but at least the domain is found!

 

I know there is a way to get the organization data using this link:

https://ORGANIZATION.api.REGION.dynamics.com/XrmServices/2011/Organization.svc

and if I use my organization data, the browser cannot find the domain... but using the other organization I have access to, it works OK!

 

So maybe I am missing something?

 

Also one important thing that may matter is that if I go to admin.microsoft.com, go to Settings/Services & add-ins, and then I click on Dynamics CRM I end up with an error saying:

no instances found for this user ID

 

You have signed in with a user ID that cannot log into Dynamics 365. Make sure that you have an active Dynamics 365 subscription and that your Dynamics 365 user account has a defined security role.

 

Could it be that as the web API I am using is 

https://ORGANIZATIONID.REGION.dynamics.com/api/data/v9.1/workflows

then it really needs Dynamics 365 (although I try to use Flow) and this is the source of the problem?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
pabloglombo
Level: Powered On

Re: I cannot work with Flow REST API

I found out that I had to create the database for that environment in the Flow admin center (going to the environment)

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: I cannot work with Flow REST API

Hi @pabloglombo ,

 

Have you take a try with an account that have an active Dynamics 365 subscription?

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

pabloglombo
Level: Powered On

Re: I cannot work with Flow REST API

I found out that I had to create the database for that environment in the Flow admin center (going to the environment)

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,650)