Exposing Workflows and Integrations as API
Tags: integration, api, webhook, slack
Published: 2021-09-28 11:23:49

---
title: Exposing Workflows and Integrations as API
published: true
date: 2021-01-28 09:00:32 UTC
tags: #integration, #api, #webhook, #slack
canonical_url: https://tech.forums.softwareag.com/t/exposing-workflows-and-integrations-as-api/238344/1
---

 

## Introduction

This article gives an overview on how to expose your workflows and integrations on [webMethods.io](http://webMethods.io) Integration as APIs.

### Prerequisites:

1. You must have an active [webMethods.io](http://webMethods.io) Integration tenant. If you do not, please request a free trial here.
2. You must have an active [webMethods.io](http://webMethods.io) API Gateway tenant. If you do not, please go to your [webMethods.io](http://webMethods.io) Integration > App Switcher > My Cloud and request a free trial.
3. You must have an active Slack account to follow along with this article.

### Procedure:

A. This section showcases how to configure a webhook on [webMethods.io](http://webMethods.io) Integration with your Slack account.

1. Login to your [webMethods.io](http://webMethods.io) Integration tenant.
2. Create a workflow and select a webhook.
3. Copy the webhook URL till /run and save it for later use.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/c/c20f1fb0a4e74fe5a5bfe0bb085f377d3acb2ef8_2_690x408.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/c/c20f1fb0a4e74fe5a5bfe0bb085f377d3acb2ef8.png "image")
4. 
Click Next and provide the below sample body for your webhook.  
{  
"text”: “”,  
"username”: “”  
}  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/3/3ea354f274daecfc10f69500dd6c4d57ef65475f.png)
5. This is it for the webhook configuration.
6. Now, select the Slack connector and configure it as shown below.  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/1/19203e013aad377d6b885aae476a303b484cdfab.png)
7. Map the webhook data with the Slack input as shown below.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/e/efaf00946abb2af5c09f0fc4a4ba2c5afb70cd4e_2_690x395.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/e/efaf00946abb2af5c09f0fc4a4ba2c5afb70cd4e.png "image")
8. This is how your workflow should look at the end.
[![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/8/8df5449a90b7e7567538a59867c0977d4e91ada1.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/8/8df5449a90b7e7567538a59867c0977d4e91ada1.png "image")

B. In this section, we will create an API representing the workflow created above.

1. Log in to your [webMethods.io](http://webMethods.io) API Gateway tenant and click on APIs.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/7/7015164266e6ba80666ceaf8b263201fc87f1d9c_2_690x103.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/7/7015164266e6ba80666ceaf8b263201fc87f1d9c.png "image")
2. Now, select Create to create an api and follow the steps shown in the proceeding steps.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/d/d8085b133906828efaea44c4d30aa68f9b2d8e4e_2_690x353.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/d/d8085b133906828efaea44c4d30aa68f9b2d8e4e.png "image")
3. Fill up the required details as shown below and proceed to Technical Information.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/1/1171f9dbd00a96643b37214e60d3a01844b31d11_2_690x402.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/1/1171f9dbd00a96643b37214e60d3a01844b31d11.png "image")
4. Paste the previously copied webhook URL in the Server URL Field and click on Add.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/9/91a03f025c067b568bbbdaa7b97b7acbeda2e921_2_690x269.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/91a03f025c067b568bbbdaa7b97b7acbeda2e921.png "image")
5. Now, add a resource like shown below.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/1/1e74ba90d83c3d3a6baec8fcbfd5373f5e680886_2_690x279.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/1/1e74ba90d83c3d3a6baec8fcbfd5373f5e680886.png "image")
6. Save the API.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/7/7e11d33d82dfb1a161c815d7806eab533cc00d80_2_690x203.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/7/7e11d33d82dfb1a161c815d7806eab533cc00d80.png "image")
7. Now, activate the API to interact with it.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/2/23cb14dea323d8d027ce4af181052c381fbf1821_2_690x330.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/2/23cb14dea323d8d027ce4af181052c381fbf1821.png "image")
8. 
Copy the Gateway endpoint.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/f/fd79b41460686b8c8d0f0098c53acc6c247cb3c9_2_690x290.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/f/fd79b41460686b8c8d0f0098c53acc6c247cb3c9.png "image")
9. Copy the webhook id following /run in the webhook URL.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/9/9160d8b347d3a4e4ff17967ef09e762bb853d076_2_616x500.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/9160d8b347d3a4e4ff17967ef09e762bb853d076.png "image")
10. To test your API, open up Postman and send a POST request to Gateway endpoint + / + webhook id with a request body.
[![image](https://aws1.discourse-cdn.com/techcommunity/optimized/2X/9/93ee401f51703184db574410e5bf589a61a6afba_2_690x307.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/93ee401f51703184db574410e5bf589a61a6afba.png "image")

[Read full topic](https://tech.forums.softwareag.com/t/exposing-workflows-and-integrations-as-api/238344/1)