cURL
curl --request POST \
--url https://api.altur.io/api/v1.0/message \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"end_user_id": "<string>",
"content": "<string>"
}
'import requests
url = "https://api.altur.io/api/v1.0/message"
payload = {
"agent_id": "<string>",
"end_user_id": "<string>",
"content": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: '<string>', end_user_id: '<string>', content: '<string>'})
};
fetch('https://api.altur.io/api/v1.0/message', 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",
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([
'agent_id' => '<string>',
'end_user_id' => '<string>',
'content' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.altur.io/api/v1.0/message"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"end_user_id\": \"<string>\",\n \"content\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.altur.io/api/v1.0/message")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"end_user_id\": \"<string>\",\n \"content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"end_user_id\": \"<string>\",\n \"content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"thread": {
"id": "<string>",
"agent": {
"id": "<string>",
"name": "<string>"
},
"end_user": {
"id": "<string>",
"display_name": "<string>",
"info": "<string>"
},
"integration": {
"id": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z",
"active": true,
"blocked": true,
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"assigned_to": [
{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>"
}
]
},
"messages": [
{
"thread_id": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"media": "<string>",
"sent_by_user": "<string>",
"read": true
}
],
"in_response_to": {
"thread_id": "<string>",
"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
Send Message
Sends Message to the Thread between a Agent and an EndUser, returns the Message created from the request, the Messages generated in response, and returns information about the Thread between the Agent and EndUser
POST
/
message
cURL
curl --request POST \
--url https://api.altur.io/api/v1.0/message \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "<string>",
"end_user_id": "<string>",
"content": "<string>"
}
'import requests
url = "https://api.altur.io/api/v1.0/message"
payload = {
"agent_id": "<string>",
"end_user_id": "<string>",
"content": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({agent_id: '<string>', end_user_id: '<string>', content: '<string>'})
};
fetch('https://api.altur.io/api/v1.0/message', 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",
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([
'agent_id' => '<string>',
'end_user_id' => '<string>',
'content' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.altur.io/api/v1.0/message"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"end_user_id\": \"<string>\",\n \"content\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.altur.io/api/v1.0/message")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"end_user_id\": \"<string>\",\n \"content\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.altur.io/api/v1.0/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"end_user_id\": \"<string>\",\n \"content\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"thread": {
"id": "<string>",
"agent": {
"id": "<string>",
"name": "<string>"
},
"end_user": {
"id": "<string>",
"display_name": "<string>",
"info": "<string>"
},
"integration": {
"id": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z",
"active": true,
"blocked": true,
"tags": [
{
"id": "<string>",
"name": "<string>"
}
],
"assigned_to": [
{
"id": "<string>",
"email": "<string>",
"first_name": "<string>",
"last_name": "<string>"
}
]
},
"messages": [
{
"thread_id": "<string>",
"sent_at": "2023-11-07T05:31:56Z",
"content": "<string>",
"media": "<string>",
"sent_by_user": "<string>",
"read": true
}
],
"in_response_to": {
"thread_id": "<string>",
"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.
Cuerpo
application/json
⌘I