Integrations

Incoming Webhooks for Pumble

5 min read
jovana

With the incoming webhooks, you can easily post messages from other apps into Pumble. When you create an incoming webhook, you receive a unique URL by which you can send a JSON payload with the message text.

Creating an incoming webhook #

To create a new incoming webhook:

  1. Click on your Workspace name at the top left corner
  2. Navigate to the Workspace settings
  3. Select General settings from the dropdown
  4. Click on the Incoming Webhooks section in the sidebar
  5. Click on the New Webhook button at the top right corner
  6. Choose the channel where your webhook will post messages
  7. Click on the Add incoming Webhook button to complete the process

When you create your webhook, the editor opens up automatically. There, you’ll be able to customize its name, change the channel, add a descriptive label, customize the icon, and most importantly, copy or regenerate your unique URL.

The limit rate on the incoming webhooks on Pumble is one second per webhook.

The maximum number of characters in a webhook is 10000.

Using incoming webhook to send a message #

To send a message using the incoming webhooks you just created, simply make an HTTP POST request to the unique URL you copied from the webhook editor.

The request payload should contain the text property and that text will be posted into a specified channel. Currently supported content types are:

  • application/json
  • application/x-www-form-urlencoded

Here is a sample curl request for posting to a channel using an incoming webhook using the application/x-www-form-urlencoded content type:

curl -X POST \ --location "https://api.pumble.com/workspaces/WORKSPACE-ID/incomingWebhooks/postMessage/WEBHOOK-CODE" \ --data-urlencode "payload={ \"text\": \"This is posted to general and comes from a bot named MyNewWebhook.\" }"

Here is a sample JSON curl request for posting to a channel using an incoming webhook:

curl -X POST \ --location
  "https://api.pumble.com/workspaces/WORKSPACE-ID/incomingWebhooks/postMessage/WEBHOOK-CODE" \
  -H "Content-Type: application/json" \
  -d '{"text":"This is posted to general and comes from a bot named MyNewWebhook."}}'

You can use rich text formatting for webhook messages. Here are some payload examples:

User mention:

{
   "text": "User mention: <<@{{userId}}>>, channel mention: <<#{{channelId}}>>, user group mention: <<&{{userGroupId}}>> and @here @channel"
}

Attachment:

{
   "attachments": [
       {
           "pretext": "Pretext of Pumble webhooks article",
           "title": "Pumble webhooks",
           "title_link": "https://pumble.com/help/integrations/add-pumble-apps/incoming-webhooks-for-pumble",
           "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
           "author_name": "Pumble",
           "author_link": "https://pumble.com",
           "footer": "Lorem ipsum v1.0.0",
           "footer_icon": "https://files.pumble.com/avatars/default/pumble-logo",
           "color": "green", // or hex RGB
           "ts": 1759479334
       }
   ]
}

This attachment example will send a message that looks like this:

Hyperlinks:

{
   "text": "[Markdown Hyperlink](https://pumble.com) | <a href=\"https://pumble.com\">Html hyperlink</a> | <https://pumble.com|Hyperlink>"
}

Emojis:

{
   "text": "Emojis :raised_hands: :heart:"
}

Code block:

{
   "text": "`Inline code` and ```Code block\n hello \nEnd of code block```"
}

Here’s an example message that incorporates different types of rich text formatting:

{
 "text": "Hello team! :wave: :tada:\n\n**Quick Update**:\n- Feature deployed successfully! :rocket:\n- Bugs resolved: `5`\n\n*Styling Reference:*\n- Markdown **bold**, *italic*\n- HTML <b>bold</b>, <i>italic</i>, <code>inline code</code>\n\n🔗 Useful Links:\n- [Pumble Website](https://pumble.com)\n- <a href=\"https://pumble.com\">Pumble via HTML</a>\n- <https://pumble.com|Pumble custom hyperlink> \n\n:busts_in_silhouette: Mentions:\n- Channel: <<#{{68e3a383ce5f2c8d95ff46a6}}>> \nNotifications: @here @channel \n\n:computer: Code snippet:```function greet() {\n  console.log(\"Hello, Pumble!\");\n}```"
}

This webhook message would look like this:

Error handling #

If everything is set up correctly, you’ll receive an HTTP 200 status to indicate that your incoming webhook worked and the message was sent successfully. This might not always be the case, and this action can fail for numerous reasons.

Some of the errors you might encounter if your webhooks fail are:

message: Incoming webhook is disabled.
code: 400700
The Webhook was disabled by the Workspace Admin
message: Incoming webhook is deleted.
code: 400702
The Webhook was deleted by the Workspace Admin
message: Not found.
code: 404100
Unique URL was not found and was most likely regenerated by the workspace Admin
message: You can not perform this operation.
code: 403200
You don’t have permission to post in the specified channel
message: Channel is archived.
code: 400440
The channel where the webhooks is sending messages is Archived
message: Invalid payload format.
code: 400703
Request payload is not in one of the supported formats.

Was this article helpful?

Thank you! If you’d like a member of our support team to respond to you, please drop us a note at support@pumble.com