curl --request POST \
--url https://app.flextell.ai/api/v1/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"integration_id": 123,
"is_active": true,
"bot_token": "<string>",
"webhook_enabled": true,
"webhook_base_url": "<string>"
}
'import requests
url = "https://app.flextell.ai/api/v1/channels"
payload = {
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"integration_id": 123,
"is_active": True,
"bot_token": "<string>",
"webhook_enabled": True,
"webhook_base_url": "<string>"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
provider: '<string>',
address: '<string>',
website_domain: '<string>',
integration_id: 123,
is_active: true,
bot_token: '<string>',
webhook_enabled: true,
webhook_base_url: '<string>'
})
};
fetch('https://app.flextell.ai/api/v1/channels', 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://app.flextell.ai/api/v1/channels",
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([
'name' => '<string>',
'provider' => '<string>',
'address' => '<string>',
'website_domain' => '<string>',
'integration_id' => 123,
'is_active' => true,
'bot_token' => '<string>',
'webhook_enabled' => true,
'webhook_base_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"integration_id\": 123,\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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://app.flextell.ai/api/v1/channels")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"integration_id\": 123,\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"integration_id\": 123,\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"type": "whatsapp",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"status": "closed",
"is_active": true,
"ai_reply_mode": "auto",
"connection_error": {
"code": "<string>",
"expected_address": "<string>",
"connected_address": "<string>",
"message": "<string>",
"detected_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "CHANNEL_PROVIDER_UNAVAILABLE",
"message": "<string>"
}Create a channel
A Telegram channel sent with bot_token is connected before it is saved: Telegram must accept
the token (CHANNEL_TELEGRAM_TOKEN_INVALID) and the webhook (CHANNEL_TELEGRAM_WEBHOOK_REJECTED),
otherwise nothing is created.
curl --request POST \
--url https://app.flextell.ai/api/v1/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Tenant: <x-tenant>' \
--data '
{
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"integration_id": 123,
"is_active": true,
"bot_token": "<string>",
"webhook_enabled": true,
"webhook_base_url": "<string>"
}
'import requests
url = "https://app.flextell.ai/api/v1/channels"
payload = {
"name": "<string>",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"integration_id": 123,
"is_active": True,
"bot_token": "<string>",
"webhook_enabled": True,
"webhook_base_url": "<string>"
}
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Tenant': '<x-tenant>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
provider: '<string>',
address: '<string>',
website_domain: '<string>',
integration_id: 123,
is_active: true,
bot_token: '<string>',
webhook_enabled: true,
webhook_base_url: '<string>'
})
};
fetch('https://app.flextell.ai/api/v1/channels', 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://app.flextell.ai/api/v1/channels",
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([
'name' => '<string>',
'provider' => '<string>',
'address' => '<string>',
'website_domain' => '<string>',
'integration_id' => 123,
'is_active' => true,
'bot_token' => '<string>',
'webhook_enabled' => true,
'webhook_base_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Tenant: <x-tenant>"
],
]);
$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://app.flextell.ai/api/v1/channels"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"integration_id\": 123,\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Tenant", "<x-tenant>")
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://app.flextell.ai/api/v1/channels")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"integration_id\": 123,\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/channels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"provider\": \"<string>\",\n \"address\": \"<string>\",\n \"website_domain\": \"<string>\",\n \"integration_id\": 123,\n \"is_active\": true,\n \"bot_token\": \"<string>\",\n \"webhook_enabled\": true,\n \"webhook_base_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"tenant_id": 123,
"name": "<string>",
"type": "whatsapp",
"provider": "<string>",
"address": "<string>",
"website_domain": "<string>",
"status": "closed",
"is_active": true,
"ai_reply_mode": "auto",
"connection_error": {
"code": "<string>",
"expected_address": "<string>",
"connected_address": "<string>",
"message": "<string>",
"detected_at": "2023-11-07T05:31:56Z"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "CHANNEL_PROVIDER_UNAVAILABLE",
"message": "<string>"
}Yetkilendirmeler
The access token received from the authorization server in the OAuth 2.0 flow.
Başlıklar
Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.
Gövde
The name of the channel.
255The channel type (whatsapp, instagram, website, telegram).
whatsapp, instagram, website, telegram The messaging provider backing the channel, when the type supports more than one.
255The channel address — a phone number, handle or bot identifier. Required for every type except website, and for a Telegram channel created without a bot token; a connected Telegram channel defaults to @<bot username>.
255The site the widget is embedded on, without a scheme. Required for website channels.
255^(?:localhost|(?:\d{1,3}\.){3}\d{1,3}|(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+))(?:\:\d{1,5})?$The integration this channel belongs to.
Whether the channel is active.
Pins the channel to a fixed AI reply mode (auto, semi_auto, closed). Omit to follow the clinic schedule.
auto, semi_auto, closed Telegram only. The BotFather token of the bot to connect. When given, the bot is verified and its webhook registered before the channel is saved, and the channel starts open; when omitted, only the channel record is created. Write-only: it is stored encrypted and never returned.
255^\d+:[A-Za-z0-9_-]+$Telegram only. Whether Telegram delivers incoming messages to the channel's webhook. Defaults to true.
Telegram only, non-production only. The public HTTPS base URL (for example a tunnel) the webhook is registered under. Ignored in production, which always uses the application URL.
255