cURL
curl --request GET \
--url https://api.altur.io/api/v1.0/message/{thread_id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.altur.io/api/v1.0/message/{thread_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.altur.io/api/v1.0/message/{thread_id}', 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.altur.io/api/v1.0/message/{thread_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.altur.io/api/v1.0/message/{thread_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.altur.io/api/v1.0/message/{thread_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/message/{thread_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"thread_id": "<string>",
"type": "text",
"sent_by": "AI",
"sent_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"media": "<string>",
"sent_by_user": "<string>",
"read": true
}
]{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Mensajes
Get Messages
Get all Messages in a Thread, ordered from oldest to most recently sent
GET
/
message
/
{thread_id}
cURL
curl --request GET \
--url https://api.altur.io/api/v1.0/message/{thread_id} \
--header 'Authorization: <api-key>'import requests
url = "https://api.altur.io/api/v1.0/message/{thread_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.altur.io/api/v1.0/message/{thread_id}', 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.altur.io/api/v1.0/message/{thread_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.altur.io/api/v1.0/message/{thread_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.altur.io/api/v1.0/message/{thread_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/message/{thread_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"thread_id": "<string>",
"type": "text",
"sent_by": "AI",
"sent_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"media": "<string>",
"sent_by_user": "<string>",
"read": true
}
]{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}{
"error": 123,
"message": "<string>"
}Autorizaciones
Add api-key YOUR_API_SECRET_KEY as the value of the Authorization header.
Parámetros de ruta
The identifier of the Thread to fetch
Respuesta
Array containing all Messages in the Thread
Unique identifier of the Thread the Message belongs to
Message type enum
Opciones disponibles:
text, image, audio, video, button, template, document Author of this message
Opciones disponibles:
AI, EU, SYS Datetime from when the Message was sent
Message's text content
Message's media content, if any (usually in form of URL)
Altur user id (if Message was sent manually by an in-app user)
Boolean describing if the Message is considered as read