Incoming webhooks
Post through an incoming webhook
Post one message into the webhook’s conversation, as Slack’s incoming webhooks do. The token in the path is the credential. The message shows as the app named by username, or the webhook’s name, and bots treat its text as outside content. Each webhook takes 60 posts a minute and each source IP 600. The body may be at most 64 KiB and is never logged.
POST
/
webhooks
/
messaging
/
{token}
Post through an incoming webhook
curl --request POST \
--url https://api.fluid.app/webhooks/messaging/{token} \
--header 'Content-Type: application/json' \
--data '
{
"text": "Stock alert: SKU-1042 is below its reorder point.",
"username": "Warehouse"
}
'import requests
url = "https://api.fluid.app/webhooks/messaging/{token}"
payload = {
"text": "Stock alert: SKU-1042 is below its reorder point.",
"username": "Warehouse"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Stock alert: SKU-1042 is below its reorder point.',
username: 'Warehouse'
})
};
fetch('https://api.fluid.app/webhooks/messaging/{token}', 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.fluid.app/webhooks/messaging/{token}",
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' => 'Stock alert: SKU-1042 is below its reorder point.',
'username' => 'Warehouse'
]),
CURLOPT_HTTPHEADER => [
"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.fluid.app/webhooks/messaging/{token}"
payload := strings.NewReader("{\n \"text\": \"Stock alert: SKU-1042 is below its reorder point.\",\n \"username\": \"Warehouse\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.fluid.app/webhooks/messaging/{token}")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Stock alert: SKU-1042 is below its reorder point.\",\n \"username\": \"Warehouse\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/webhooks/messaging/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Stock alert: SKU-1042 is below its reorder point.\",\n \"username\": \"Warehouse\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}{
"ok": false,
"error": "<string>"
}⌘I
Post through an incoming webhook
curl --request POST \
--url https://api.fluid.app/webhooks/messaging/{token} \
--header 'Content-Type: application/json' \
--data '
{
"text": "Stock alert: SKU-1042 is below its reorder point.",
"username": "Warehouse"
}
'import requests
url = "https://api.fluid.app/webhooks/messaging/{token}"
payload = {
"text": "Stock alert: SKU-1042 is below its reorder point.",
"username": "Warehouse"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
text: 'Stock alert: SKU-1042 is below its reorder point.',
username: 'Warehouse'
})
};
fetch('https://api.fluid.app/webhooks/messaging/{token}', 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.fluid.app/webhooks/messaging/{token}",
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' => 'Stock alert: SKU-1042 is below its reorder point.',
'username' => 'Warehouse'
]),
CURLOPT_HTTPHEADER => [
"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.fluid.app/webhooks/messaging/{token}"
payload := strings.NewReader("{\n \"text\": \"Stock alert: SKU-1042 is below its reorder point.\",\n \"username\": \"Warehouse\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.fluid.app/webhooks/messaging/{token}")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Stock alert: SKU-1042 is below its reorder point.\",\n \"username\": \"Warehouse\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/webhooks/messaging/{token}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Stock alert: SKU-1042 is below its reorder point.\",\n \"username\": \"Warehouse\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true
}{
"ok": false,
"error": "<string>"
}