Integrationen

API Integration

isidora.komaromi@cake.com

Pumble API Addon offers a seamless solution for users to interact with the Pumble API without the need for complex authentication processes. With this addon, users can generate API keys effortlessly, allowing them to send messages, reactions, and more via simple HTTP requests. Here’s how to get started:

  1. Click on +Add apps button at the bottom of the left sidebar


  2. Click on Install button next to the API app 

    A new tab will open with the consent form and integration specifics.

    It’s possible that the app has already been installed on your workspace by another user, and you will need to authorize it so that you can use it. To do it, click on the Authorize button next to the app name.

  3. Select the Workspace from the dropdown

    It is important that you are logged in to the Pumble Workspace that you choose from the dropdown.

  4. Click Allow to complete the installation

Valid commands #

There are a few specific actions that can be used to interact with API integration on Pumble:

  • /api-keys generate – addon will generate API keys for that particular user and store it in their database. Users can generate as much API keys as they want to.
  • /api-keys list – addon will list all user’s API keys
  • /api-keys delete API-KEYS-VALUE – removes user’s API keys
  • /api-keys help – to list all valid commands you can use
  • /api-keys delete all – delete all API keys at once

Generate API keys #

To generate an API key, do the following:

  1. Type /api-keys generate in the message editor in any channel (you can also add a note next to it)
  2. Press enter/Send button to complete the action

You’ll receive an ephemeral message containing the generated API key. This message is not visible to other users. Copy this key for future use. The generated key enables interaction with the Addon’s public API, allowing users to send requests and execute various actions within Pumble, including:

  • Sending messages
  • Leaving a reply to a message
  • Message deletion
  • Adding reaction to a message
  • Channel creation
  • Listing the messages in a channel (if the channel is private, Addon Bot needs to be the member of that channel)
  • Listing the channels and DMs that belong to the user who created the key

API integration can be used, for example, if you run a busy e-commerce website, and you want to keep your customer support team informed about new orders in real-time. By integrating Pumble with API, you can set up an automated notification system that alerts your customer support team in Pumble channels whenever a new order is placed.

Interact with the public API of the Addon #

You can interact with the Addon’s public API to send messages and perform other actions in Pumble using the generated API key.

To do it, you need to send a request on any API platform (for example Insomnia, Postman, Jmeter, etc). The request should have the following format:

  • HTTP base URL: https://pumble-api-keys.addons.marketplace.cake.com
  • Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message
  • Body: The structure of the body depends on the specific action you intend the integration to perform, but it always needs to be JSON body. Some actions do not require a body.

Here are the predefined formats used for the HTTP request and body:

Send messages #

POST https://pumble-api-keys.addons.marketplace.cake.com/sendMessage — Send a message to the given channel ( by it’s name ) with text being the supplied text.

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

Body:

{

  “text” : “text of the message”,

  “channel” : “general”,

  “asBot” : true

}

To send a message from your personal account and not as a bot, asBot parameter in the request body should be false.

Reply to a message #

POST https://pumble-api-keys.addons.marketplace.cake.com/sendReply  — Send a reply to the message with the given id, in the given channel, with text being the supplied text.

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

Body:

{

    “channel” : “general”,

    “messageId” : “65c4ba025f3c124940579c7f”,

    “text” : “reply to a message”

}

Add reaction to a message #

POST https://pumble-api-keys.addons.marketplace.cake.com/addReaction — Add a reaction to the message with the given id. Reaction must be a string code.

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

Body:

{

    “messageId”: “65c4a8ab99f15a6b2150e0f0”,

    “reaction”: “:grin:”

}

Create channel #

POST https://pumble-api-keys.addons.marketplace.cake.com/createChannel  — Create a new channel with the given name & description.

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

Body:

{

    “name” : “channel name”,

    “type” : “PUBLIC”,

    “description”: “”

}

Channel Type can be PUBLIC or PRIVATE.

Delete message #

DELETE https://pumble-api-keys.addons.marketplace.cake.com/deleteMessage?messageId={messageID}&channel=random — Delete the message with the given id from the channel with the given name.

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

Body: none

List messages in a channel #

GET https://pumble-api-keys.addons.marketplace.cake.com/listMessages?channel=random — List messages on the given channel. Cursor & limit are optional (they are used for pagination the same way as in the listV1 endpoint in API).

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

List all channels and DMs #

Body: none

GET https://pumble-api-keys.addons.marketplace.cake.com/listChannels — List all the channels of your workspace.

Header: { Api-Key: API-KEY-VALUE } – enter the API key that you generated in the message editor and received as an ephemeral message

Body: none

List all users #

Body: none

GET https://pumble-api-keys.addons.marketplace.cake.com/listUsers — List all users of your workspace.

Header: { Api-Key: API-KEY-VALUE } — enter the API key that you generated in the message editor and received as an ephemeral message

War der Artikel hilfreich?

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