Post a message
curl --request POST \
--url https://api.mantle.chat/v1/channels/{channelId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"threadKey": "<string>",
"replyToMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actions": [
{
"id": "<string>",
"label": "<string>",
"style": "<string>"
}
]
}
'import requests
url = "https://api.mantle.chat/v1/channels/{channelId}/messages"
payload = {
"text": "<string>",
"threadKey": "<string>",
"replyToMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actions": [
{
"id": "<string>",
"label": "<string>",
"style": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
threadKey: '<string>',
replyToMessageId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
actions: [{id: '<string>', label: '<string>', style: '<string>'}]
})
};
fetch('https://api.mantle.chat/v1/channels/{channelId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mantle.chat/v1/channels/{channelId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'threadKey' => '<string>',
'replyToMessageId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'actions' => [
[
'id' => '<string>',
'label' => '<string>',
'style' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mantle.chat/v1/channels/{channelId}/messages"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"threadKey\": \"<string>\",\n \"replyToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"style\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mantle.chat/v1/channels/{channelId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"threadKey\": \"<string>\",\n \"replyToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"style\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mantle.chat/v1/channels/{channelId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"threadKey\": \"<string>\",\n \"replyToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"style\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate": true,
"threadRootMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_token",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "not_in_channel",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "channel_not_found",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "channel_archived",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "rate_limited",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "post_failed",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "service_unavailable",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}Bots
Post a message
POST
/
v1
/
channels
/
{channelId}
/
messages
Post a message
curl --request POST \
--url https://api.mantle.chat/v1/channels/{channelId}/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "<string>",
"threadKey": "<string>",
"replyToMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actions": [
{
"id": "<string>",
"label": "<string>",
"style": "<string>"
}
]
}
'import requests
url = "https://api.mantle.chat/v1/channels/{channelId}/messages"
payload = {
"text": "<string>",
"threadKey": "<string>",
"replyToMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actions": [
{
"id": "<string>",
"label": "<string>",
"style": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
text: '<string>',
threadKey: '<string>',
replyToMessageId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
actions: [{id: '<string>', label: '<string>', style: '<string>'}]
})
};
fetch('https://api.mantle.chat/v1/channels/{channelId}/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mantle.chat/v1/channels/{channelId}/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'threadKey' => '<string>',
'replyToMessageId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'actions' => [
[
'id' => '<string>',
'label' => '<string>',
'style' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mantle.chat/v1/channels/{channelId}/messages"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"threadKey\": \"<string>\",\n \"replyToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"style\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mantle.chat/v1/channels/{channelId}/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"threadKey\": \"<string>\",\n \"replyToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"style\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mantle.chat/v1/channels/{channelId}/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"threadKey\": \"<string>\",\n \"replyToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"actions\": [\n {\n \"id\": \"<string>\",\n \"label\": \"<string>\",\n \"style\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"messageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"duplicate": true,
"threadRootMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "invalid_token",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "not_in_channel",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "channel_not_found",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "channel_archived",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "rate_limited",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "post_failed",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}{
"error": {
"code": "service_unavailable",
"message": "<string>",
"requestId": "<string>",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Required string length:
1 - 128Pattern:
^[A-Za-z0-9._:-]+$Path Parameters
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$Body
application/json
Response
Success
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$