curl --request GET \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>'
{
"success": true,
"messages": [
{
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:00Z"
},
{
"id": "msg_789ghi",
"chatId": "chat_123abc",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "I'd be happy to help! What would you like to know?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:15Z"
}
],
"message": "Messages fetched successfully"
}
Retrieves all messages in a specific chat
curl --request GET \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>'
{
"success": true,
"messages": [
{
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:00Z"
},
{
"id": "msg_789ghi",
"chatId": "chat_123abc",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "I'd be happy to help! What would you like to know?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:15Z"
}
],
"message": "Messages fetched successfully"
}
curl --request GET \
--url https://api.yourdomain.com/api/chats/chat_123abc/messages \
--header 'Authorization: Bearer <token>'
{
"success": true,
"messages": [
{
"id": "msg_456def",
"chatId": "chat_123abc",
"role": "user",
"parts": [
{
"type": "text",
"text": "Hello, how can you help me today?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:00Z"
},
{
"id": "msg_789ghi",
"chatId": "chat_123abc",
"role": "assistant",
"parts": [
{
"type": "text",
"text": "I'd be happy to help! What would you like to know?"
}
],
"attachments": [],
"createdAt": "2024-01-17T10:30:15Z"
}
],
"message": "Messages fetched successfully"
}