User
Authentication
HTTP Authentication, scheme: bearer
User
Get user info
Code samples
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', 'https://fakestoreapi.ru/user');
xhr.setRequestHeader('Accept', 'application/json');
xhr.setRequestHeader('Authorization', 'Bearer {access-token}');
xhr.send(data);GET /user
Example responses
200 Response
Responses
5XX
Unknown
Server error
None
4XX
Unknown
Check response message
None
To perform this operation, you must be authenticated by means of one of the following methods: bearer
Update user info
Code samples
PATCH /user
Body parameter
Parameters
Responses
To perform this operation, you must be authenticated by means of one of the following methods: bearer
Update user password
Code samples
PATCH /user/password
Body parameter
Parameters
Responses
To perform this operation, you must be authenticated by means of one of the following methods: bearer
Get user cart
Code samples
GET /user/cart
Parameters
l
query
number
false
Items limit on page ( from 1 to 50 )
p
query
number
false
Items page ( min 1 )
Example responses
200 Response
Responses
To perform this operation, you must be authenticated by means of one of the following methods: bearer
Add product to user cart
Code samples
POST /user/cart
Parameters
pid
query
string
true
Product id
Responses
To perform this operation, you must be authenticated by means of one of the following methods: bearer
Remove products from user cart
Code samples
DELETE /user/cart
Body parameter
Parameters
Responses
To perform this operation, you must be authenticated by means of one of the following methods: bearer
Last updated