Messages

Список всіх публично доступних методів для взаємодії з API.

GET

Get messages from conversation

/conversation/read/{type}/{id}

Get messages from given conversation.

Метод запита

GEThttps://api.stableproxy.com/v2/conversation/read/{type}/{id}

Параметри запиту

ІдентифікаторПравилаПриклад
searchНе обов'язковоnullablestring161
per-pageНе обов'язковоnullableinteger25
pageНе обов'язковоnullableinteger99
sort-byНе обов'язковоnullablestringapp\_validators\_ex_in_rule""
sort-orderНе обов'язковоnullablestringin:asc, desc"asc"
type1required""
id1required27

Приклади коду

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"
  }
}