Get messages from conversation
/conversation/read/{type}/{id}Get messages from given conversation.
Способ запроса
GEThttps://api.stableproxy.com/v2/conversation/read/{type}/{id}
Параметры запроса
| Идентификатор | Правила | Пример |
|---|---|---|
| searchНе обязательно | nullablestring | 161 |
| per-pageНе обязательно | nullableinteger | 25 |
| pageНе обязательно | nullableinteger | 99 |
| sort-byНе обязательно | nullablestringapp\_validators\_ex_in_rule | "" |
| sort-orderНе обязательно | nullablestringin:asc, desc | "asc" |
| type | 1required | "" |
| id | 1required | 27 |
Примеры кода
1const baseUrl = "https://api.stableproxy.com/v2";2const response = await fetch(baseUrl + "/conversation/read/{type}/{id}", {3 method: "GET",4 headers: {5 "Content-Type": "application/json"6 }7});8const data = await response.json();Примеры ответов
Success response200application/json
{
"data": {
"current_page": 1,
"data": [
{
"id": 1231,
"uuid": "0WDJ2iZOIWrXIGdeEm2QnEfk",
"message": "I'm here to help! If you have a specific question or issue, please let me know.",
"type": "SUPPORT",
"conversation_id": "o3g2pxjmy6",
"user_id": -1,
"created_at": "2024-10-09T08:23:54.000000Z",
"updated_at": "2024-10-09T08:26:49.000000Z",
"role": "ai",
"read_at": "2024-10-09 11:26:49",
"media": [],
"user": {
"name": "GPT",
"avatar_url": "http://api.stableproxy.com/img/ai-avatar.webp",
"created_at": null,
"role": "Нейро мережа"
}
}
],
"first_page_url": "http://api.stableproxy.com/v2/conversation/read/support/o3g2pxjmy6?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://api.stableproxy.com/v2/conversation/read/support/o3g2pxjmy6?page=1",
"next_page_url": null,
"path": "http://api.stableproxy.com/v2/conversation/read/support/o3g2pxjmy6",
"per_page": 15,
"prev_page_url": null,
"to": 7,
"total": 7
},
"good": true,
"timestamp": 1731399956,
"cause": {
"type": "user",
"user_id": 1,
"token_id": 302,
"token_sign": "8491affc7321d0925064c90eeeee53d2"
}
}