Skip to main content

Get All Prizes Requests

This endpoint retrieves all requests of loyalty prizes

info

This operation requires authentication to see own requests and admin or editor to see all requests.

HTTP Request

GET /api/v2/loyalty/request/

Parameters

NameInTypeRequiredDescription
limitqueryintegerfalseNumber of results to return per page
offsetqueryintegerfalseThe initial index from which to return the results
searchquerystringfalseA search term
statusquerystringfalseThe request status
user_idquerystringfalseThe user id
prize_idquerystringfalseThe prize id
orderingquerystringfalseWhich field to use when ordering the results

Enumerated Values

ParameterValueDescription
status0pending
status1refused
status2sent

Example Request


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

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


Responses

StatusMeaningDescriptionSchema
200OKResponse status codeInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» countintegerfalsenoneTotal results count
» nextstring(uri)¦nullfalsenoneNext page url
» previousstring(uri)¦nullfalsenonePrevious page url
» results[LoyaltyPrizeUser]falsenoneList of results

Example responses

{
"count": "integer",
"next": "string(uri)",
"previous": "string(uri)",
"results": [
{
"id": "integer",
"user": {User},
"prize": {Prize},
"prize_points": "integer",
"pending_at": "string",
"status": "integer",
"status_description": "string"
}
]
}