/
How to send Messages to TeamHub Chat using Studio

How to send Messages to TeamHub Chat using Studio

Overview

This guide explains how to send messages to a TeamHub Chat channel or direct message via CPaaS Studio.

There are 2 major steps to create a Studio app that sends messages to TeamHub Chat.

Step 1. Create a TeamHub Chat webhook.

kszjji5d-20240426-141952.png

Step 2 . Create a CPaaS Studio integration flow.

image-20240525-105856.png

Step 1 - Create a TeamHub Chat webhook

How to access the Temahub Chat webhooks

  • Access Sangoma TeamHub or use the TeamHub desktop app.

  • Select Chat.

  • Click the Integration Icon at the top of the page.

  • Select Integrations from the menu.

  • Click on Incoming WebHook.

    image-20240523-113136.png

 

kszjji5d-20240426-141952.png

 


How to Create or Edit a TeamHub Chat Webhook

  • Access the Temahub Chat webhooks.

  • To add a new webhook click the Add Incoming Webhook button.

  • To edit an existing webhook, search for the desired webhook, then click the 'Edit' link located to the right of the webhook.

image-20240523-113940.png

Enter the TeamHub Chat Webhook parameters

After clicking Create or Edit, the Webhook parameter page is displayed. Enter the following parameters:

  • Title - Specify a title, of up to 64 characters, for the webhook settings page.

  • Description - Describe your incoming webhook.

  • Channel - Select the default public or private channel that receives the webhook payloads. When setting up the webhook, you must belong to the private channel.

  • This can be overridden via the external application.

  • Lock to this channel - Select this option to ensure messages are only sent to this Channel.

  • Username - Specify the username this integration will post as. Usernames must be in lowercase, be up to 64 characters, and can contain numbers and the symbols "-", "_", and ".". If left blank, the name specified by the webhook creator is used.

  • Profile Picture - Enter the URL of a .png or .jpg file for the profile picture of this integration when posting. The file should be at least 128 pixels by 128 pixels. If left blank, the profile picture specified by the webhook creator is used.

  • Click the Save button if this a new Webhook or the Update button if you are updating an existing webhook.

image-20240523-114847.png

How to find and Copy the Webhook URL

  • Access the Temahub Chat webhooks.

  • Find the desired Incoming Webhook in the list of webhooks. 

  • Click the Copy icon next to the URL for desired Webhook.

Note: Any external integration app (Studio App) will need this URL in order to send messages to this Webhook.

image-20240523-121037.png

Step 2 - Create a CPaaS Studio integration flow

Note: Studio is currently not a public application.

How to access the Studio application

  • Access the Studio application

  • To create a new application, click the NEW APPLICATION button.

  • To edit an existing application, find the desired application, and click on the application name.

image-20240524-174826.png

Enter the data in APPLICATION DETAILS page

When creating a new application you must enter the following application details information:

  • Name - Enter the Name of the integration flow.

  • Description - Enter a Description.

    • I.e. TeamHub Clat Integration.

  • Version - Enter the App version.

  • Version description - Enter a Version Description (optional).

  • Click the CREATE APPLICATION button.

For existing applications the APPLICATION DETAILS page can viewed and edited by clicking on the application name at the top of the edit application page.

image-20240523-131945.png

Creating a flow

When the flow page displays, Complete the following steps.

  • Click the + icon at the top of the page to add a new flow. 

  • Enter the following in the flow details pop-up.

    • Name - Provide a name for the flow

      • I.E. Post Message to TeamHub

  • Description - Provide a description of the flow.

  • Type - Select a flow type. Default is standard.

  • Parent - No parent is required if this is the only flow.

  • Click the Create Now button.

Edit flow details

  • To access the flow details of an existing flow, click the flow name at the top of the flow page.

image-20240523-142523.png

Editing a Studio Application flow

initially the flow page will display with a default Trigger and End Flow node.

  • Trigger(s) - The default trigger is a manual trigger. It is good to keep the manual trigger for testing purposes.

    • Drag and drop an additional trigger node as needed from the panel on the left side. (Example: “Call Event Trigger” to detect an extension called 911 call.)

      • Configure the added trigger as required.

    • Drag and drop the HTTP Post node.

    • In the Trigger node(s) set the success option to the call the http post step.

    • Follow the step below to Configure the HTTP Post node.

image-20240525-110440.png

 

 


Configuring the HTTP POST Node

Hover over the HTTP POST node, then click the Editing icon.

STEP INFORMATION

  • Select the Config tab.

  • Display Name * - Enter the step Name.

  • Notes - Enter any desired notes about the step.

  • CONFIGURE HTTP POST:
    Specify the data and how it manipulated.

    • Content type * - Select Application-JSON to send messages to TeamHub Chat.

    • URL - Copy and paste the URL from the previously created TeamHub Chat Webhook. Click HERE for instructions.

    • Valid HTTP Return codes - (Optional) Enter a comma-separated list of valid codes for HTTP responses.

    • Follow redirects - Not require for this TeamHub Chat integrations.

    • Select Connection - Not require for this TeamHub Chat integrations.

  • PARAMETERS

    • Add and configure any required parameters, the click the ADD PARAMETER button.

  • HEADERS - Not require for this TeamHub Chat integrations.

    • Define any custom headers for your data, the click the ADD HEADER Button

  • Data:

CONNECTIONS

  • Success Connection * - Select the next node/step to be executed (I.e. End Flow).

  • Error Connection - If a step was created to be execute in the event of an error, in this step select the desired step to go to.

  • Timeout Connection - If a step was created to execute in the event of a Timeout, select the desired step to go to.

  • Timeout - Enter a desired time before this step will timeout. The default is 30000.

 

Studio_Flow_CFG_TTL_2-20240523-165045.png

OUTPUT - If the configuration has created any output data, Click the OUTPUT tab to test in this section/Tab.

 

How to test this Studio application

  • Access the desired Studio application. Click HERE for access instructions.

  • Click the Run icon.

How to Publish a Studio application

  • Access the desired Studio application. Click HERE for access instructions.

  • Click the Publish icon.

image-20240524-192453.png

Sample JSON Message

{ "attachments": [ { "fallback": "test", "color": "#025DA6", "pretext": "This an Urgent Notification.", "text": "Sangoma is pleased to announce that our Urgent Notify app can now send internal notifications to TeamHub Chat. These notifications can be sent to public channels, private channels, and as direct messages. With this feature you no longer have to register an SMS Campaign in order to send internal notices to internal teams or staff.", "author_name": "Urgent Notify", "author_icon": "https://s2s-knowledgebase.s3.amazonaws.com/bob-testing/urgent-notify_icon.png", "author_link": "https://Sangogma.com/", "title": "Urgent Notify integration with TeamHub Chat", "title_link": "https://sangomakb.atlassian.net/wiki/spaces/TeamHub/pages/203784193/", "fields": [ { "short": false, "title": "Great Formatting Options", "value": "Here are some examples of additional formatting options " }, { "short": true, "title": "Column One", "value": "Col 1 text" }, { "short": true, "title": "Column Two", "value": "Col 2 text" } ], "image_url": "https://s2s-knowledgebase.s3.amazonaws.com/bob-testing/sangoma-teamhub-logo.png" } ] }

 

Click here ( https://sangoma.atlassian.net/wiki/spaces/PMGMT/overview ) to locate this Product Manager.

Product Version:

 

Source Document URL:

 

Comments: