Get Message Codes
GET
/v0/messages/{message_id}/codes
curl -s "https://api.yoagent.dev/v0/messages/msg_01je56wqswfmn9pgbc1wq8tjgq/codes" \ -H "Authorization: Bearer $YOAGENT_KEY"const response = await fetch("https://api.yoagent.dev/v0/messages/msg_01je56wqswfmn9pgbc1wq8tjgq/codes", { headers: { Authorization: `Bearer ${process.env.YOAGENT_KEY}`, },});if (!response.ok) throw new Error(await response.text());const data = await response.json();import os
import requests
response = requests.get( "https://api.yoagent.dev/v0/messages/msg_01je56wqswfmn9pgbc1wq8tjgq/codes", headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"}, timeout=60,)response.raise_for_status()data = response.json()One-time codes found in a message.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”message_id
required
Message Id
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
CodeList
One-time codes of a message.
object
message_id
required
Message Id
string
codes
required
Codes
Array<object>
CodeA one-time code found in a message when it arrived, with the text around it.
object
code
required
Code
string
context
required
Context
string
Example
{ "message_id": "msg_01je56wqswfmn9pgbc1wq8tjgq", "codes": [ { "code": "482913", "context": "Your sign-in code is 482913." } ]}default
Section titled “default”An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: Errors.