Send Slack message
curl --request POST \
--url https://api.tightknit.ai/admin/v0/messages \
--header 'Authorization: Bearer <token>' \
--header 'content-type: <content-type>' \
--data '
{
"channel": "<string>",
"text": "<string>",
"thread_ts": "<string>"
}
'import requests
url = "https://api.tightknit.ai/admin/v0/messages"
payload = {
"channel": "<string>",
"text": "<string>",
"thread_ts": "<string>"
}
headers = {
"content-type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'content-type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({channel: '<string>', text: '<string>', thread_ts: '<string>'})
};
fetch('https://api.tightknit.ai/admin/v0/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.tightknit.ai/admin/v0/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([
'channel' => '<string>',
'text' => '<string>',
'thread_ts' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"content-type: <content-type>"
],
]);
$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.tightknit.ai/admin/v0/messages"
payload := strings.NewReader("{\n \"channel\": \"<string>\",\n \"text\": \"<string>\",\n \"thread_ts\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.tightknit.ai/admin/v0/messages")
.header("content-type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"channel\": \"<string>\",\n \"text\": \"<string>\",\n \"thread_ts\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tightknit.ai/admin/v0/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"channel\": \"<string>\",\n \"text\": \"<string>\",\n \"thread_ts\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}Messages
Send Slack message
Sends a Slack message to a channel or user. By default, messages are sent by the Tightknit app branded as the community, using your customized icon and name.
POST
/
admin
/
v0
/
messages
Send Slack message
curl --request POST \
--url https://api.tightknit.ai/admin/v0/messages \
--header 'Authorization: Bearer <token>' \
--header 'content-type: <content-type>' \
--data '
{
"channel": "<string>",
"text": "<string>",
"thread_ts": "<string>"
}
'import requests
url = "https://api.tightknit.ai/admin/v0/messages"
payload = {
"channel": "<string>",
"text": "<string>",
"thread_ts": "<string>"
}
headers = {
"content-type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'content-type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({channel: '<string>', text: '<string>', thread_ts: '<string>'})
};
fetch('https://api.tightknit.ai/admin/v0/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.tightknit.ai/admin/v0/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([
'channel' => '<string>',
'text' => '<string>',
'thread_ts' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"content-type: <content-type>"
],
]);
$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.tightknit.ai/admin/v0/messages"
payload := strings.NewReader("{\n \"channel\": \"<string>\",\n \"text\": \"<string>\",\n \"thread_ts\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
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.tightknit.ai/admin/v0/messages")
.header("content-type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"channel\": \"<string>\",\n \"text\": \"<string>\",\n \"thread_ts\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tightknit.ai/admin/v0/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"channel\": \"<string>\",\n \"text\": \"<string>\",\n \"thread_ts\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}{
"success": true,
"error": {
"code": "<string>",
"message": "<string>",
"hint": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Available options:
application/json Response
Message sent
Was this page helpful?
⌘I

