Get Attachment
GET
/v0/messages/{message_id}/attachments/{attachment_id}
curl -sSf "https://api.yoagent.dev/v0/messages/msg_01je56wqswfmn9pgbc1wq8tjgq/attachments/att_01je56wqswfmn9pgbc1wq8tjgq" \ -H "Authorization: Bearer $YOAGENT_KEY" \ -o answer.binconst response = await fetch("https://api.yoagent.dev/v0/messages/msg_01je56wqswfmn9pgbc1wq8tjgq/attachments/att_01je56wqswfmn9pgbc1wq8tjgq", { headers: { Authorization: `Bearer ${process.env.YOAGENT_KEY}`, },});if (!response.ok) throw new Error(await response.text());const bytes = await response.arrayBuffer();import os
import requests
response = requests.get( "https://api.yoagent.dev/v0/messages/msg_01je56wqswfmn9pgbc1wq8tjgq/attachments/att_01je56wqswfmn9pgbc1wq8tjgq", headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"}, timeout=60,)response.raise_for_status()content = response.contentDownload an attachment (always as a download, never rendered).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”message_id
required
Message Id
string
attachment_id
required
Attachment Id
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/octet-stream
default
Section titled “default”An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.