Skip to main content

Get All Users

This endpoint retrieves the list of all users

info

This operation requires authentication.

HTTP Request

GET /api/v2/user/

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseNumber of results to return per page.
offsetqueryintegerfalseThe initial index from which to return the results.
searchquerystringfalseA search term. Search in fields: username, real_name.
usernamequerystringfalseFilter using field username.
genderquerystringfalseFilter using field gender type.
real_namequerystringfalseFilter using field real_name.
locationquerystringfalseFilter using field location.
descriptionquerystringfalseFilter using field description.
orderingquerystringfalseOrdering fields (eg: ?ordering=username). Minus char is used for descending ordering, eg. -username

Example Request

const headers = {
'Accept':'application/json',
'Authorization: Bearer <token>'
};

fetch('/api/v2/user/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});

Responses

StatusMeaningDescriptionSchema
200OKnoneInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» countintegerfalsenoneTotal results count
» nextstring(uri)¦nullfalsenoneNext page url
» previousstring(uri)¦nullfalsenonePrevious page url
» resultslist(User)falsenoneList of results

Example responses

{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": 0,
"username": "string",
"real_name": "string",
"email": "user@example.com",
"email_isvalid": true,
"date_joined": "2019-08-24T14:15:22Z",
"bio": "string",
"location": "string",
"location_lat_lng": "string",
"position_lat_lng": "string",
"date_of_birth": "2019-09-23",
"description": "string",
"gender": "Male",
"status": "a",
"website": "https://example.com",
"avatar": "string",
"cover": "string",
"ext_id": 3,
"tags": [],
"reputation": 39,
"connection_status": "string",
"followings_counter": 7,
"followers_counter": 2,
"posts_counter": 4,
"discussions_counter": 3,
"statuses_counter": 0,
"polls_counter": 1
}
]
}