{"id":110744,"date":"2016-11-02T01:03:48","date_gmt":"2016-11-02T08:03:48","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/call-flow-restapi\/"},"modified":"2016-11-02T01:03:48","modified_gmt":"2016-11-02T08:03:48","slug":"call-flow-restapi","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/call-flow-restapi\/","title":{"rendered":"Calling Microsoft Flow from your application"},"content":{"rendered":"
Microsoft Flow allows you to turn complex repetitive tasks into automated multistep flows. In many cases, you want your flow to be triggered by an event, such as a document update. In others, you want to let the end user initiate a flow. In this case, Microsoft Flow will serve as an integration glue between your application and large number of other services. For example, you may want the user to click on a button and send an email to her customers. In this article, we will demonstrate five simple steps that will help you build flow and trigger it using simple REST API call. For the sake of simplicity, we are using the Postman Chrome App<\/a> to send REST API calls.<\/p>\n Before we start implementation, let’s think about the format of the call. In this example, triggering an email from application, we want to pass the following information from the client to the flow: email address, email subject and the text of the email. Our request body will look like this: \nWe will also need a JSON schema defining the format of the request. To simplify schema creation, you can use one of many schema generators available on the web. We used jsonschema.net<\/a>. \u00a0<\/p>\nStep 1:<\/h2>\n
\n\u00a0<\/p>\n
\n\u00a0\u00a0\u00a0 “emailaddress”:”<your address goes here>”,
\n\u00a0\u00a0\u00a0 “emailSubject”: “Hello”,
\n\u00a0\u00a0\u00a0 “emailBody”: “Hello from Microsoft Flow”
\n}<\/div>\n
\n\u00a0
\nCopy\/paste the request body and click on Generate Schema. The tool will generate a schema like this one:<\/p>\n\n \n{\n \"$schema\": \"http:\/\https://www.microsoft.com/json-schema.org\/draft-04\/schema#\"<\/a>,\n \"type\": \"object\",\n \"properties\": {\n \"emailadress\": {\n \"type\": \"string\"\n },\n \"emailSubject\": {\n \"type\": \"string\"\n },\n \"emailBody\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"emailadress\",\n \"emailSubject\",\n \"emailBody\"\n ]\n}<\/pre>\n
Step 2:<\/h2>\n