Thanks for your interest in BetterCloud's custom integrations feature, which is available to our Enterprise- level customers, and those who are able to access BetterCloud's API. In this module, we'll walk you through some of the basics of webhooks and explain how you create custom integration webhooks.
Webhooks in BetterCloud allow you to reach out from BetterCloud to a third-party application. Therefore, if you wanted to perform an action in that third-party application, such as create or delete a user, you'ld use a webhook to do this. When going to add an action for your workflows, you'll see that all webhooks have a few the following fields:
- Name - How the action is displayed within your workflow builder.
- Description - Identifies the action, should you ever share it to the BetterCloud community.
- URL - The endpoint you want to hit. To get the endpoint, you'll need to visit the application's API documentation and find the endpoint you want to hit.
Now you'll need to tell BetterCloud how you want to perform the action:
- Method - Looks for any of the HTTP Verbs, such as POST, PUT, PATCH, DELETE (and any of the accepted HTTP Verbs) that'll execute to the endpoint URL.
- Headers - Always sent with the request. Headers usually include a content type, such as application JSON, and almost always have an authorization, secret, or environment variable within them. Anything appended to the header will display as a dynamic field in the headers, allowing BetterCloud to pass your defined variables into the headed as needed.
- Body - Applicable if you're doing a POST, PUT, or PATCH. Here's where you build your HTTP request.
You'll need to get a successful test of the webhook in order to publish your action. You'll find a test button at the very bottom of the window. Once your webhook succeds, you'll be able to move onto the next screen and select dynamic fields. These dynamic fields are the response that the API returns to us when your test was successful. Here, you can decide what dynamic fields you'd like to display in BetterCloud's workflow builder. If you'd like to use any of the results from the webhook in a dynamic action, further down in your workflow actions list, here's where you'ld select this. Once you select Save, the action will be added to your custom integration, and you'll now be able to add the action into the THEN portion of your workflows.
By the end of this video, you will be able to:
- Find where you should go in order to build a custom integration
- Name and find your application's logo
- Set your authentication type
- Define your environment variables
- Create an action from a webhook by filling in all required fields (as noted above) and build your endpoint URL using dynamic fields
- Build a test payload, getting a successful response
- Select dynamic fields
- Save your webhook and find it in the workflow builder
Hitting Endpoints and Understanding Restrictions
It's important to note that just because you can perform an action on a third-party provider's site (or through their app), it doesn't mean that it's possible to do via an API. BetterCloud will need an exposed endpoint to perform a task. Therefore, if you want to create a teammate in Intercom, BetterCloud will need an API endpoint to perform the task. As of this articles publication, this is not possible as the endpoint for creating teammates has not been exposed publicly (or one does not exist). Equally important, you'll need to review any SKU/version restrictions for the application. As an example, Slack does not currently allow provisioning if you're on their most basic version. While the endpoint is there (and it can be done via an API POST), your POST will be rejected if you have the Basic version of Slack.
The next module, Custom Integration Authentication Types, explores how you can properly connect with a third-party application through BetterCloud. To view the next module, click here.