Twake
⬅️ Go on twake
  • ☀️ Twake
  • Getting started
    • ▶️Use Twake on twake.app
    • 🏗️Install on your server
      • 🎡Scale with Twake
    • ⚙️Configuration
      • 🔒Security
      • 🔗Custom domain + HTTPS
        • Apache2 configuration
      • 💌Configure mail server
      • 🎨Customisation
      • 🔌Connectors and plugins
      • 👨‍💻 Authentication modes
        • Using Keycloak (LDAP, OpenID and more)
        • Installing Twake with LemonLDAP (LDAP, OpenID and more)
  • How to use it
    • 👋Welcome to Twake !
    • 🧰Console
      • Users
    • 🏢Company & workspace
      • Invite user from Chat
      • Rights
    • 💠Applications
      • 💬Chat
        • Channels
        • Message
      • 📂Drive
        • File and folder
        • Share file with public link
      • 📆Calendar
      • ✅Tasks
      • 🔃Connectors
        • n8n
    • 🖥️Desktop and mobile app
    • 🔒Privacy
  • Developers API
    • 🏠Home
    • 🥇Getting started
      • Create your first application
      • Authenticate with Postman
      • Send a message with your application
      • Trigger action from command
    • ⚙️Application settings
      • Api
      • Display
      • Privileges
      • Identity
    • 📖API Reference
      • Webhook
      • Drive
      • Message
        • DELETE Request
        • POST Request
      • Authentication
    • 🧱Blocks
  • Internal Documentation
    • 🥇Get started
    • 🎨Twake Ecosystem Guidelines
    • 📚Our stack
    • 🧱Backend and APIs
      • 🔑(WIP) Authentication
      • 👥Users and workspaces
      • 🍎Applications
        • Database models
        • REST APIs
      • 🎩Channels and tabs
        • Database models
      • 💬Messages
        • Database models
      • 📄Files
        • Database models
        • REST APIs
        • Resumable.js
      • 📲Notifications
        • Database models
      • 🛠️Twake service development
        • What is a service in Twake ?
        • Create a new service
        • Platform/Technical services
          • Database ORM platform service
    • 🖥️Web, desktop and mobile
      • Table
      • ObjectModal
        • ObjectModalTitle
        • ObjectModalSeparator
        • ObjectModalSectionTitle
        • ObjectModalFormTitle
      • UserListManager
      • MediumPopupManager
      • MenuManager
    • 🎭Translation
Powered by GitBook
On this page
  • Introduction:
  • Prerequisites:
  • Steps:
  • 1. Send message as a new Thread
  • 2. Send message as a Thread answer
  • 3. Applications can send customized messages

Was this helpful?

  1. Developers API
  2. Getting started

Send a message with your application

Send a message through API

PreviousAuthenticate with PostmanNextTrigger action from command

Last updated 3 years ago

Was this helpful?

Introduction:

This guide will introduce you to send message with your application in Twake.

Prerequisites:

  • You have already created a Twake application.

  • Your application is installed and saved in your company.

Steps:

1. Send message as a new Thread

  • Find the app's token according to

  • Find the identifiers to target a channel:

    • Company's id: $COMPANY_ID

    • Workspace's id: $WOKSPACE_ID

    • Channel's id: $CHANNEL_ID

  • Set the message you want to send:

    • Minimal:

      $MESSAGE = { "text": "Hello world !" }

    • To take full advantage of the messages capability in Twake see the

  • Send POST request with :

    • Url: https://web.twake.app/api/messages/v1/companies/$COMPANY_ID/threads

    • Headers: { "Content-Type": "application/json", Authorization: "Bearer " + $APP_TOKEN }

    • Body: { resource: { participants: [ { type: "channel", id: $CHANNEL_ID, company_id: $COMPANY_ID, workspace_id: $WORKSPACE_ID, }, ], }, options: { $MESSAGE }, }

  • This POST request will return a

2. Send message as a Thread answer

  • Find the identifiers to target a channel:

    • Company's id: $COMPANY_ID

    • Workspace's id: $WOKSPACE_ID

    • Channel's id: $CHANNEL_ID

    • Thread's id: $THREAD_Id

  • Set the message you want to send:

    • Minimal:

      $MESSAGE = { "text": "Hello world !" }

  • Send POST request with :

    • Url: https://web.twake.app/api/messages/v1/companies/$COMPANYID/threads/$THREAD_ID

    • Headers: { "Content-Type": "application/json", Authorization: "Bearer " + $APP_TOKEN }

    • Body: { resource: { $MESSAGE } }

3. Applications can send customized messages

Find the app's token according to

To take full advantage of the messages capability in Twake see the

This POST request will return a

The object have a property called "block" that allow your application to send messages which contains more than a simple string. For example in an application message you can display an iFrame, buttons, menu selector, etc... Combining all this options you can create everything you want up to the limit of your imagination. To understand how to create powerful message using the block property see .

🥇
MessageObject
MessageObject
MessageObject
blocks
MessageObject
ThreadObject
1. Log your Application
1. Log your Application