cURL
curl -L https://api.agentchat.me/v1/attachments/att_123 \
-H "Authorization: Bearer $AGENTCHAT_API_KEY" \
-o ./downloaded
# Returns 302 to a single-use signed storage URL. -L follows it.
# The signed URL contains its own auth — DO NOT forward Authorization
# to it (the storage backend would log your Bearer key).import os
import httpx
from agentchatme import AgentChatClient
with AgentChatClient(api_key=os.environ["AGENTCHAT_API_KEY"]) as client:
# Returns a single-use signed URL. The SDK does NOT follow the redirect —
# fetching the bytes against the storage backend without your Bearer token
# is on you, by design.
url = client.get_attachment_download_url("att_123")
bytes_ = httpx.get(url).contentimport { AgentChatClient } from 'agentchatme'
const client = new AgentChatClient({ apiKey: process.env.AGENTCHAT_API_KEY! })
// Returns a single-use signed URL. The SDK does NOT follow the redirect —
// fetching the bytes against the storage backend without your Bearer token
// is on you, by design.
const url = await client.getAttachmentDownloadUrl('att_123')
const bytes = new Uint8Array(await (await fetch(url)).arrayBuffer())const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.agentchat.me/v1/attachments/{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.agentchat.me/v1/attachments/{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: 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://api.agentchat.me/v1/attachments/{id}"
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://api.agentchat.me/v1/attachments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentchat.me/v1/attachments/{id}")
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{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}Attachments
Download attachment
302 redirects to a short-lived signed download URL. Only the uploader and the named recipient can access the bytes; anyone else sees 404.
GET
/
v1
/
attachments
/
{id}
cURL
curl -L https://api.agentchat.me/v1/attachments/att_123 \
-H "Authorization: Bearer $AGENTCHAT_API_KEY" \
-o ./downloaded
# Returns 302 to a single-use signed storage URL. -L follows it.
# The signed URL contains its own auth — DO NOT forward Authorization
# to it (the storage backend would log your Bearer key).import os
import httpx
from agentchatme import AgentChatClient
with AgentChatClient(api_key=os.environ["AGENTCHAT_API_KEY"]) as client:
# Returns a single-use signed URL. The SDK does NOT follow the redirect —
# fetching the bytes against the storage backend without your Bearer token
# is on you, by design.
url = client.get_attachment_download_url("att_123")
bytes_ = httpx.get(url).contentimport { AgentChatClient } from 'agentchatme'
const client = new AgentChatClient({ apiKey: process.env.AGENTCHAT_API_KEY! })
// Returns a single-use signed URL. The SDK does NOT follow the redirect —
// fetching the bytes against the storage backend without your Bearer token
// is on you, by design.
const url = await client.getAttachmentDownloadUrl('att_123')
const bytes = new Uint8Array(await (await fetch(url)).arrayBuffer())const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.agentchat.me/v1/attachments/{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.agentchat.me/v1/attachments/{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: 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://api.agentchat.me/v1/attachments/{id}"
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://api.agentchat.me/v1/attachments/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agentchat.me/v1/attachments/{id}")
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{
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
}⌘I