Settings
A list of all publicly available methods for interacting with the API.
GET
Get settings -/user/settings
Query method
GEThttp://apilocal.stableproxy.com/v2/user/settings
Query parameters
Identifier | Regulations | Example |
---|---|---|
password-confirmationNot necessarily | required_with:passwordsame:password | "RYwSU8d3" |
Code examples
JavaScript
1async function getUserSettings() {
2 const baseUrl = 'http://apilocal.stableproxy.com/v2';
3 const req = await fetch(baseUrl + '/user/settings?' + Object.entries({
4 "password-confirmation": "RYwSU8d3"
5 }).map(([key, value]) => key + "=" + value).join('&'), {
6 method: 'GET',
7 headers: {
8 'Authorization': 'API-Token [YOUR TOKEN]',
9 'Content-Type': 'application/json'
10 }
11 }
12 );
13
14 const res = await req.json();
15}
Examples of answers
Success response
PUT
Update settings -/user/settings
Query method
PUThttp://apilocal.stableproxy.com/v2/user/settings
Query parameters
Identifier | Regulations | Example |
---|---|---|
password-confirmationNot necessarily | required_with:passwordsame:password | "RYwSU8d3" |
nameNot necessarily | nullablestring | 12 |
emailNot necessarily | nullablestringemailunique:users, email | 64 |
currencyNot necessarily | nullablestringcurrency_code | "USD" |
passwordNot necessarily | nullablestring | 79 |
localeNot necessarily | nullablestringin:uk, en, pl, ru | "uk" |
Code examples
JavaScript
1async function putUserSettings() {
2 const baseUrl = 'http://apilocal.stableproxy.com/v2';
3 const req = await fetch(baseUrl + '/user/settings', {
4 method: 'PUT',
5 headers: {
6 'Authorization': 'API-Token [YOUR TOKEN]',
7 'Content-Type': 'application/json'
8 },
9 body: JSON.stringify({
10 "password-confirmation": "RYwSU8d3",
11 "name": 12,
12 "email": 64,
13 "currency": "USD",
14 "password": 79,
15 "locale": "uk"
16 }),
17 }
18 );
19
20 const res = await req.json();
21}
Examples of answers
Success response
POST
User avatar -/user/avatar
Query method
POSThttp://apilocal.stableproxy.com/v2/user/avatar
Query parameters
Identifier | Regulations | Example |
---|---|---|
files | arraydistinctrequired | 1 |
files..* | requiredfiledistinct | 5361 |
Code examples
JavaScript
1async function postUserAvatar() {
2 const baseUrl = 'http://apilocal.stableproxy.com/v2';
3 const req = await fetch(baseUrl + '/user/avatar', {
4 method: 'POST',
5 headers: {
6 'Authorization': 'API-Token [YOUR TOKEN]',
7 'Content-Type': 'application/json'
8 },
9 body: JSON.stringify({
10 "files": 1,
11 "files..*": 5361
12 }),
13 }
14 );
15
16 const res = await req.json();
17}