{"id":110779,"date":"2016-12-01T09:14:47","date_gmt":"2016-12-01T17:14:47","guid":{"rendered":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/custom-web-api-as-custom-api\/"},"modified":"2016-12-01T09:14:47","modified_gmt":"2016-12-01T17:14:47","slug":"custom-web-api-as-custom-api","status":"publish","type":"power-automate","link":"https:\/\/www.microsoft.com\/en-us\/power-platform\/blog\/power-automate\/custom-web-api-as-custom-api\/","title":{"rendered":"Guest Posts on using Web APIs as a Custom API in Microsoft Flow"},"content":{"rendered":"
With Custom APIs in Microsoft Flow, you can use from flow any custom actions you build as a developer. Gene Vangampelaere\u00a0has written a great blog post<\/a> on how to get started with a Web API and register that as a Custom API in a flow.\u00a0After you’ve followed the below tutorial, you can check out another post, by Tsuyoshi Matsuzaki, on how to set up Authentication for your Web API<\/a>. This covers both how to use Azure AD and Google authentication.<\/p>\n Thanks to Gene and Tsuyoshi, on behalf of the Flow team! If anyone else has blog posts they would like to highlight, please let us know and we can highlight it on the blog.<\/p>\n —-<\/p>\n Microsoft Flow is the new workflow engine from Microsoft. With flow you can create automated workflows between your favorite apps and services to get notifications, synchronize files, collect data, and more.<\/p>\n You can find Microsoft Flow at: https:\/\/flow.microsoft.com<\/a><\/p>\n Flow contains many predefined templates to use: https:\/\/flow.microsoft.com\/en-us\/templates\/<\/a>. Things like send reminders via the Flow mobile app to you phone when you get a mail or sync your Dropbox files with OneDrive, \u2026<\/p>\n <\/p>\n The real power of Microsoft flow is the fact that you can use you own services and extend your flows with custom data. In the following demo I will create a flow to send a notification email to users from a custom REST web service.<\/p>\n To start I create a custom C# ASP.NET WebApi application in Visual Studio 2015. I called the application \u201cSwaggerDemo<\/a>\u201c.<\/p>\n If you don\u2019t want to create it yourself, you can download the solution from my GitHub account<\/a>.<\/p>\n <\/p>\n The Api contains the following code:<\/p>\n <\/p>\n In the old days we created soap based web services that used WSDL to describe the service. Nowadays we use Swagger.io to do this. It is pretty easy to implement Swagger to an existing WebApi.<\/p>\n Use NuGet to add the Swashbuckle<\/a> package to you project.<\/p>\n <\/p>\n To know more about this, check this page: https:\/\/devcenter.wintellect.com\/paulballard\/give-your-rest-apis-some-metadata-swagger<\/a>!<\/p>\n When you run your project now you get to see the \u201cSwagger\u201d output:<\/p>\n http:\/\/localhost:17406\/swagger\/<\/p>\n <\/p>\n Now you can deploy your server to a public webserver and we can start using it with Flow.<\/p>\n To start using the Api we need to create a new service in Flow. Services are used to provide you the data and do operations.<\/p>\n To add your custom API, go to the Flow dashboard via https:\/\/flow.microsoft.com<\/a> and click the settings icon in the top right corner:<\/p>\n <\/p>\n Select \u201cCustom API\u2019s\u201d and click the \u201cCreate custom API\u201d button in the next screen.<\/p>\nUse your custom WebApi with Microsoft Flow<\/h2>\n