Send a message with your application
Send a message through API
Last updated
Was this helpful?
Send a message through API
Last updated
Was this helpful?
This guide will introduce you to send message with your application in Twake.
You have already created a Twake application.
Your application is installed and saved in your company.
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
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 } }
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 .