cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Dhito
Level: Power Up

[ASK] Flow Request API from python

Dear All,

 

right now im trying to trigger a flow from a python code (in jupyter):

Request > Office 364 send an email > Response

 

As per now, the flow has been created successfully and tested both using built in tester and PostMan

 

However, when im trying to use the code in python (using built in code generator by PostMan), i have this error :

 

{"error":{"code":"AuthorizationFailed","message":"You do not have permissions to perform action 'run' on scope '/triggers/manual/paths/'. Verify you are making the request with the appropriate HTTP method. See http://aka.ms/logic-trigger for details."}}

 

Am i missing something? the request from PostMan in python as below (some parts are redacted) :

 

import requests

url = "URL_FROM_FLOW_IN_HERE_REDACTED"

querystring = {"api-version":"2016-06-01","sp":"%2Ftriggers%2Fmanual%2Frun","sv":"1.0","sig":"SIGNATURE_FROM_FLOW_IN_HERE_REDACTED"}

payload = "{\r\n \"emailSubjectAA\": \"HEHEHE\",\r\n \"emailBodyAA\": \"HOHOHO\"\r\n}"
headers = {
'Content-Type': "application/json",
'User-Agent': "PostmanRuntime/7.17.1",
'Accept': "*/*",
'Cache-Control': "no-cache",
'Postman-Token': "TOKEN_FROM_POSTMAN_IN_HERE_REDACTED",
'Host': "AZURE_FLOW_HOST_IN_443_REDACTED",
'Accept-Encoding': "gzip, deflate",
'Content-Length': "62",
'Connection': "keep-alive",
'cache-control': "no-cache"
}

response = requests.request("POST", url, data=payload, headers=headers, params=querystring)

print(response.text)

 

Thank you

1 REPLY 1
Community Support Team
Community Support Team

Re: [ASK] Flow Request API from python

 

Hi @Dhito ,

 

Could you provide the flow configuration and run history?

From the error message, it seems that there is a problem with identity authentication, and there is no corresponding permission to perform related operations.

 

Best Regards,

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Users Online
Currently online: 200 members 4,402 guests
Please welcome our newest community members: