Tutorial: Creating a Hello World Bot
In this guide, we’ll walk through how to set up a simple "Hello World" bot:
Configure a Custom OAuth App and generate API credentials.
Finding a thread ID to target.
Sending your first message.
Updating or creating threads.
Adding attachments.
1. Configure a Custom OAuth App
In Glue, navigate to the Apps section of the workspace settings.
Locate OAuth App under the Custom configuration section, and click Add.

Enter a Name and a Description for your Custom App, and click Create app.

Once created, you'll be able to see your app's Client ID and Client Secret, which are your credentials to authenticate with the Glue API.
Reference OAuth 2.0 Authentication to use your Client ID and secret to generate your Access Tokens.
Step 2. Using the SendMessage Mutation
The core building block for integrations is the sendMessage mutation. This is how you post into an existing thread or create a new one.
Here’s the GraphQL definition we'll use:
mutation SendMessage($input: SendMessageInput!) {
sendMessage(input: $input) {
thread {
id
subject
}
message {
id
text
}
}
}Step 3. Finding a Thread ID
Every message needs a target thread, so let's find one.
To see what Threads your App can see, we'll start by running this query:
query Query {
threads {
edges {
node {
id
subject
}
}
}
}Sample response:
{
"data": {
"threads": {
"edges": [
{
"node": {
"id": "thr_1234lrtjf6gLyiQrscylCtqpxeG",
"subject": "🍮 Fans of Flan Chat"
}
},
]
}
}
}Let's store this thread ID for the next step.
Not seeing any Threads? Let's check Group Membership
The App you just created only has access to Groups it has been added to. By default, your newly created App is not part of any Group, and a Groups query will return no results.
This is intentional! Your App shouldn't have access to DMs and private messages in closed groups, after all. You can verify this by specifying GroupPreview in your query to see the list of Groups you are not added to.
Adding Apps to Groups
In Glue, navigate to a group you want to grant access to your App.
In the three dot menu in the top right corner, select Apps to open the Apps modal.
The modal should looks something like this:

To check to see the Groups the App has been added to, specify Group in your query:
query Query {
workspace {
groups {
edges {
node {
... on Group {
id
name
}
}
}
}
}
}You might see a response like this:
{
"data": {
"workspace": {
"groups": {
"edges": [
{
"node": {
"id": "grp_1234EYwyzBEbFbNeTAJCtFw460",
"name": "🔍 Bots Welcome!"
}
},
{
"node": {
"id": "grp_1234lrnK07Tc6GNv5Npqto7qTqK",
"name": "🍮 Fans of Flan"
}
}
]
}
}
}
}To find a thread ID:
In the Glue app, navigate to the thread.
Open the menu and select Copy share link.
Paste the link — thread IDs start with
thr_...and group IDs withgrp_....
For example in the following URL:
https://app.gluegroups.com/thr_2hSyORgf8VqMLg0ADIvTi9oY6Nk?t=Chatthe thread ID is thr_2hSyORgf8VqMLg0ADIvTi9oY6Nk.
Step 4. Send Your First Message
Let’s post “Hello World!” into our thread. Replace the threadID with the one you copied above.
{
"input": {
"threadID": "thr_2hSyORgf8VqMLg0ADIvTi9oY6Nk",
"message": {
"text": "Hello World! 👋"
}
}
}Run this mutation, and your bot has spoken. 🎉
Step 5. Creating a New Thread
If you know your recipients, you can also start a new thread and send the first message in one go. Just pass a thread object instead of a threadID.
{
"input": {
"thread": {
"recipients": ["grp_2hSyORgf8VqMLg0ADIvTi9oY6Nk"],
"subject": "Hello World Bot waves into the workspace!",
"externalID": "HELLOBOT-INTRO-THREAD"
},
"message": {
"text": "Hello World, I'm the Hello Bot!",
"externalID": "hellobot-starter-message"
}
}
}This creates a new thread in the target group and posts the message as the starter message.
Wrap Up
That’s it 🎉 — you now know how to:
Post a simple “Hello World!” into a thread.
Create new threads on the fly.
With these basics, you can build bots that announce deploys, report incidents, or connect Glue to your internal systems.
Last updated
Was this helpful?
