Skip to main content

Get User's Preferences

This endpoint retrieves all user's preferences.

info

This operation requires that the user authenticated is the same as {id} or that the user has the admin role to view all the preferences.

HTTP Request

GET /api/v2/user/{id}/preference/

Parameters

NameInTypeRequiredDescription
idpathstringtrueA unique integer value identifying the current user id (can also be used 'me' to identify the user currently authenticated)
searchquerystringfalseA string used to search a key parameter for user id; it's an exact match so the string must be a key
keyquerystringfalseIt works like the search parameter

Example Request


const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};

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

Responses

StatusMeaningDescriptionSchema
200OKList of user's preferenceslist(User Preferences)

Example responses

{
"count": "integer",
"next": "string(uri)",
"previous": "string(uri)",
"results": [
{
"id": "integer",
"user_id": "integer",
"key": "string",
"value": "json",
"created_at": "string",
"last_updated_at": "string"
}
]
}