Get All Prizes
This endpoint retrieves all prizes
info
This operation requires authentication and admin or editor role to filter active prizes.
HTTP Request
GET /api/v2/loyalty/prize/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
limit | query | integer | false | Number of results to return per page. |
offset | query | integer | false | The initial index from which to return the results. |
search | query | string | false | A search term. |
active | query | string | false | Filter by active only for editor or admin users |
ordering | query | string | false | Which field to use when ordering the results. |
Example Request
- JavaScript
- Bash
const headers = {
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/loyalty/prize/',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X GET /api/v2/loyalty/prize/ \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access_token}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | none | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» count | integer | false | none | none |
» next | string(uri)¦null | false | none | none |
» previous | string(uri)¦null | false | none | none |
» results | [LoyaltyPrize] | false | none | none |
Example responses
- 200
{
"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,
"active": true,
"title": "string",
"description": "string",
"points": 0,
"link": "https://example.com",
"image": "string",
"created_at": "2019-08-24T14:15:22Z",
"lastmod_datetime": "2019-08-24T14:15:22Z",
"created_by": "string"
}
]
}