curl --request POST \
--url https://app.timelines.global/integrations/api/messages/to_chat_name \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chat_name": "MyChat",
"reply_to": "<string>",
"text": "hello, world!",
"file_uid": "afa9d4dd-978d-4a14-aa1b-bd65c272e645",
"label": "customer",
"attachment_template_id": 123456
}
'import requests
url = "https://app.timelines.global/integrations/api/messages/to_chat_name"
payload = {
"chat_name": "MyChat",
"reply_to": "<string>",
"text": "hello, world!",
"file_uid": "afa9d4dd-978d-4a14-aa1b-bd65c272e645",
"label": "customer",
"attachment_template_id": 123456
}
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({
chat_name: 'MyChat',
reply_to: '<string>',
text: 'hello, world!',
file_uid: 'afa9d4dd-978d-4a14-aa1b-bd65c272e645',
label: 'customer',
attachment_template_id: 123456
})
};
fetch('https://app.timelines.global/integrations/api/messages/to_chat_name', 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.timelines.global/integrations/api/messages/to_chat_name",
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([
'chat_name' => 'MyChat',
'reply_to' => '<string>',
'text' => 'hello, world!',
'file_uid' => 'afa9d4dd-978d-4a14-aa1b-bd65c272e645',
'label' => 'customer',
'attachment_template_id' => 123456
]),
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://app.timelines.global/integrations/api/messages/to_chat_name"
payload := strings.NewReader("{\n \"chat_name\": \"MyChat\",\n \"reply_to\": \"<string>\",\n \"text\": \"hello, world!\",\n \"file_uid\": \"afa9d4dd-978d-4a14-aa1b-bd65c272e645\",\n \"label\": \"customer\",\n \"attachment_template_id\": 123456\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://app.timelines.global/integrations/api/messages/to_chat_name")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chat_name\": \"MyChat\",\n \"reply_to\": \"<string>\",\n \"text\": \"hello, world!\",\n \"file_uid\": \"afa9d4dd-978d-4a14-aa1b-bd65c272e645\",\n \"label\": \"customer\",\n \"attachment_template_id\": 123456\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.global/integrations/api/messages/to_chat_name")
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 \"chat_name\": \"MyChat\",\n \"reply_to\": \"<string>\",\n \"text\": \"hello, world!\",\n \"file_uid\": \"afa9d4dd-978d-4a14-aa1b-bd65c272e645\",\n \"label\": \"customer\",\n \"attachment_template_id\": 123456\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"message_uid": "<string>"
}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}Send Message to Chat Name
Send a message to an existing WhatsApp chat or group specified by its name in Timelines Global.
curl --request POST \
--url https://app.timelines.global/integrations/api/messages/to_chat_name \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chat_name": "MyChat",
"reply_to": "<string>",
"text": "hello, world!",
"file_uid": "afa9d4dd-978d-4a14-aa1b-bd65c272e645",
"label": "customer",
"attachment_template_id": 123456
}
'import requests
url = "https://app.timelines.global/integrations/api/messages/to_chat_name"
payload = {
"chat_name": "MyChat",
"reply_to": "<string>",
"text": "hello, world!",
"file_uid": "afa9d4dd-978d-4a14-aa1b-bd65c272e645",
"label": "customer",
"attachment_template_id": 123456
}
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({
chat_name: 'MyChat',
reply_to: '<string>',
text: 'hello, world!',
file_uid: 'afa9d4dd-978d-4a14-aa1b-bd65c272e645',
label: 'customer',
attachment_template_id: 123456
})
};
fetch('https://app.timelines.global/integrations/api/messages/to_chat_name', 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.timelines.global/integrations/api/messages/to_chat_name",
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([
'chat_name' => 'MyChat',
'reply_to' => '<string>',
'text' => 'hello, world!',
'file_uid' => 'afa9d4dd-978d-4a14-aa1b-bd65c272e645',
'label' => 'customer',
'attachment_template_id' => 123456
]),
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://app.timelines.global/integrations/api/messages/to_chat_name"
payload := strings.NewReader("{\n \"chat_name\": \"MyChat\",\n \"reply_to\": \"<string>\",\n \"text\": \"hello, world!\",\n \"file_uid\": \"afa9d4dd-978d-4a14-aa1b-bd65c272e645\",\n \"label\": \"customer\",\n \"attachment_template_id\": 123456\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://app.timelines.global/integrations/api/messages/to_chat_name")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chat_name\": \"MyChat\",\n \"reply_to\": \"<string>\",\n \"text\": \"hello, world!\",\n \"file_uid\": \"afa9d4dd-978d-4a14-aa1b-bd65c272e645\",\n \"label\": \"customer\",\n \"attachment_template_id\": 123456\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.timelines.global/integrations/api/messages/to_chat_name")
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 \"chat_name\": \"MyChat\",\n \"reply_to\": \"<string>\",\n \"text\": \"hello, world!\",\n \"file_uid\": \"afa9d4dd-978d-4a14-aa1b-bd65c272e645\",\n \"label\": \"customer\",\n \"attachment_template_id\": 123456\n}"
response = http.request(request)
puts response.read_body{
"status": "ok",
"data": {
"message_uid": "<string>"
}
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}{
"message": "<string>",
"status": "error"
}chat_id or Send Message to Phone instead.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
A JSON describing recipient and message payload.
an exact name of the chat (or group) as appears in Timelines Global)
"MyChat"
UID of the message this message replies to. Must reference a message in the same workspace and WhatsApp account. Null or empty string is ignored.
plain text message
"hello, world!"
attachment UID
"afa9d4dd-978d-4a14-aa1b-bd65c272e645"
assign label to the chat, in which the message is sent (create new label, if not exists)
"customer"
a template ID of the attachment to be sent. The template must be created in the workspace before sending a message with it.
123456

