Hello!
A couple of days ago I wrote a post where I shared how to use a Http Request as a trigger to be able to invoke a Flow definition from an external App (link). Today I´ll share an example with a bit of C# code to launch a Flow.
Let’s start with the definition of the Flow with 4 steps
- Request
- Create a file in OneDrive for Business with the contents of the Body that is received
- Send a Push Notification
- Return a code HTTP 200 in the Response
Remember to copy the Url to invoke the flow. A sample C# source code may be similar the following image:
A couple of notes
- Lines 10 to 15, create a JSON message from a C# class
- With the body converted to JSON, I use JsonSchema.Net to create the Schema that I then add to the definition of the Flow
- Lines 17 to 22, made the call to the Flow using RestSharp (link)
Ready! Our Flow Console App is complete and now we can run the app to call the Flow. Once the Flow is invoked we can see how the process triggers a notification to our device, with the link for access to the Url of the message!
The sample code can be downloaded from here (link)
Greetings @ Toronto
El Bruno
References
- Microsoft Flow
- JsonSchema.Net
- NuGet, RestSharp
- El Bruno, How to invoke a Flow from an external app using HTTP Request
- El Bruno, How to review a Flow process
- El Bruno, Push Notification Support
42 comments