Read a message
curl --request GET \
--url https://app.artil.dev/api/agents/{id}/messages/{messageId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.artil.dev/api/agents/{id}/messages/{messageId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.artil.dev/api/agents/{id}/messages/{messageId}', 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.artil.dev/api/agents/{id}/messages/{messageId}",
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: Bearer <token>"
],
]);
$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://app.artil.dev/api/agents/{id}/messages/{messageId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.artil.dev/api/agents/{id}/messages/{messageId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.artil.dev/api/agents/{id}/messages/{messageId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"addressId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"direction": "inbound",
"counterpart": "<string>",
"subject": "<string>",
"text": "<string>",
"attachments": [
{
"name": "<string>",
"type": "<string>",
"size": 123
}
],
"status": "received",
"refusal": "self",
"error": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_input",
"message": "<string>"
}
}Messages
Read a message
Read a message the agent received or sent.
GET
/
agents
/
{id}
/
messages
/
{messageId}
Read a message
curl --request GET \
--url https://app.artil.dev/api/agents/{id}/messages/{messageId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.artil.dev/api/agents/{id}/messages/{messageId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.artil.dev/api/agents/{id}/messages/{messageId}', 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.artil.dev/api/agents/{id}/messages/{messageId}",
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: Bearer <token>"
],
]);
$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://app.artil.dev/api/agents/{id}/messages/{messageId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.artil.dev/api/agents/{id}/messages/{messageId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.artil.dev/api/agents/{id}/messages/{messageId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"addressId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"channel": "email",
"direction": "inbound",
"counterpart": "<string>",
"subject": "<string>",
"text": "<string>",
"attachments": [
{
"name": "<string>",
"type": "<string>",
"size": 123
}
],
"status": "received",
"refusal": "self",
"error": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "invalid_input",
"message": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
The message
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$The agent's address the message came to or went from
Pattern:
^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$Available options:
email, sms Available options:
inbound, outbound Who sent an inbound message, or the recipients of an outbound one
Show child attributes
Show child attributes
Available options:
received, refused, sending, sent, failed Why a refused message did not wake the agent
Available options:
self, spam, plan_limit, rate_limit, sender, unverified Why a failed message was not sent