Wiadomości

Lista wszystkich publicznie dostępnych metod interakcji z API.

GET

Pobieranie wiadomości z konwersacji -/conversation/read/{type}/{id}

Metoda zapytania

GEThttp://apilocal.stableproxy.com/v2/conversation/read/{type}/{id}

Parametry zapytania

IdentyfikatorRegulaminPrzykład
searchNie koniecznienullablestring161
per-pageNie koniecznienullableinteger25
pageNie koniecznienullableinteger99
sort-byNie koniecznienullablestringapp\_validators\_ex_in_rule""
sort-orderNie koniecznienullablestringin:asc, desc"asc"
type1required""
id1required27

Przykłady kodu

1async function getConversationRead() {
2   const baseUrl = 'http://apilocal.stableproxy.com/v2';
3   const req = await fetch(baseUrl + '/conversation/read/{type}/{id}'
4      .replace("{type}", "")
5      .replace("{id}", 27) + '?' + Object.entries({
6         "search": 161,
7         "per-page": 25,
8         "page": 99,
9         "sort-by": "",
10         "sort-order": "asc"
11      }).map(([key, value]) => key + "=" + value).join('&'), {
12         method: 'GET',
13         headers: {
14            'Content-Type': 'application/json'
15         }
16      }
17   );
18   
19   const res = await req.json();
20}

Przykłady odpowiedzi

POST

Wyślij wiadomość -/conversation/send/{type}/{id}

Metoda zapytania

POSThttp://apilocal.stableproxy.com/v2/conversation/send/{type}/{id}

Parametry zapytania

IdentyfikatorRegulaminPrzykład
messageNie koniecznierequired_without:files1382
filesNie konieczniearraydistinct2
files..*requiredfiledistinct5652
type1required""
id1required91

Przykłady kodu

1async function postConversationSend() {
2   const baseUrl = 'http://apilocal.stableproxy.com/v2';
3   const req = await fetch(baseUrl + '/conversation/send/{type}/{id}'
4      .replace("{type}", "")
5      .replace("{id}", 91), {
6         method: 'POST',
7         headers: {
8            'Content-Type': 'application/json'
9         },
10         body: JSON.stringify({
11            "message": 1382,
12            "files": 2,
13            "files..*": 5652
14         }),
15      }
16   );
17   
18   const res = await req.json();
19}

Przykłady odpowiedzi

PUT

Oznaczanie wiadomości jako przeczytanej -/conversation/read/{type}/{id}/{uid}

Metoda zapytania

PUThttp://apilocal.stableproxy.com/v2/conversation/read/{type}/{id}/{uid}

Parametry zapytania

IdentyfikatorRegulaminPrzykład
type1required""
id1required84
uid1required46

Przykłady kodu

1async function putConversationRead() {
2   const baseUrl = 'http://apilocal.stableproxy.com/v2';
3   const req = await fetch(baseUrl + '/conversation/read/{type}/{id}/{uid}'
4      .replace("{type}", "")
5      .replace("{id}", 84)
6      .replace("{uid}", 46), {
7         method: 'PUT',
8         headers: {
9            'Content-Type': 'application/json'
10         }
11      }
12   );
13   
14   const res = await req.json();
15}

Przykłady odpowiedzi