Функции
Список всех доступных методов для взаимодействия с API.
GET
Получение пользовательских функций -/user/features
Способ запроса
GEThttp://apilocal.stableproxy.com/v2/user/features
Примеры кода
JavaScript
1async function getUserFeatures() {
2 const baseUrl = 'http://apilocal.stableproxy.com/v2';
3 const req = await fetch(baseUrl + '/user/features', {
4 method: 'GET',
5 headers: {
6 'Authorization': 'API-Token [YOUR TOKEN]',
7 'Content-Type': 'application/json'
8 }
9 }
10 );
11
12 const res = await req.json();
13}
Примеры ответов
Success response
PUT
Переключаемые функции -/user/features
Способ запроса
PUThttp://apilocal.stableproxy.com/v2/user/features
Параметры запроса
Идентификатор | Правила | Пример |
---|---|---|
features | requiredarray | [] |
status | requiredex-boolean | false |
redirect-urlНе обязательно | nullableurl | 956 |
features.* | requiredstringdistinctin:notify.mail, notify.telegram, notify.sms, notify.push | "notify.mail" |
Примеры кода
JavaScript
1async function putUserFeatures() {
2 const baseUrl = 'http://apilocal.stableproxy.com/v2';
3 const req = await fetch(baseUrl + '/user/features', {
4 method: 'PUT',
5 headers: {
6 'Authorization': 'API-Token [YOUR TOKEN]',
7 'Content-Type': 'application/json'
8 },
9 body: JSON.stringify({
10 "features": [],
11 "status": false,
12 "redirect-url": 956,
13 "features.*": "notify.mail"
14 }),
15 }
16 );
17
18 const res = await req.json();
19}