Webhooks
Last updated
Was this helpful?
Last updated
Was this helpful?
Webhooks allow you to send messages and create threads inside of Glue by making a simple POST to the webhook endpoint. Here is a basic example that sends a message to the group chat for the group with ID grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk
.
In Glue, navigate to the Apps section of the workspace settings.
Locate Webhook in the list and click Add.
Enter a name and description, and then click Create.
After creating, you can see and copy the URL for the webhook.
In order to send a webhook, you'll need the ID of a group or thread.
To do this, navigate to the appropriate group or thread, open the menu, and then select Copy share link.
Paste the link and then look for an identifier in the URL. Group IDs start with grp_...
and thread IDs start with thr_...
If you are using the app from your browser, you can also look for these values in the URL bar. Note that at times, multiple IDs may be present depending on what you're viewing.
In this case, you can see the group ID of grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk
in the following URL:
https://app.gluegroups.com/grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk?t=Chat
Use this value in the target
field of your webhook payload.
Here are the fields that you can send to the webhook endpoint. These fields should be sent as JSON with Content-Type application/json
.
text
Required. The text of the message to send. By default, this is treated as markdown.
target
Required. The ID of a thread or group to send to.
For a group, a message will be sent to the chat unless a threadSubject
is specific - in this case a thread will be created in the group instead.
For a thread, a message will be sent to the thread. When specifying a thread target, you cannot create threads by specifying a threadSubject
.
Note: For the workspace wide, "General" group, the workspace id (wks_...
) functions as the group ID. Use the full ID including "wks_".
threadSubject
If specified, a thread will be created instead of just sending a message.
The target
must be a group if a subject is specified.
uniqueBy
Specify a value here to be able to update this message after it is created. If you call the webhook again with the same value, it will update the existing message instead of generating a new one. The uniqueBy value should be unique for the the thread or chat that the message is sent to.
threadBy
If specified, the webhook will send follow up messages to created threads with the same value. The first message will create the thread and then the following messages will be appending to that thread.
At a minimum, you must specify a target
and text
to send a message via a webhook.
The additional examples below demonstrate more advanced functionality.
File attachments
Automatic link parsing
Link previews
Option to send plain text instead of markdown for the text
field