Rewards

The rewards that belong to a page that belongs to the authenticated user

get
Get page rewards

https://api.petje.af/v1/page/:pageId/rewards
This endpoint allows you to get the rewards that belongs to the selected page. Scope: pages.read
Request
Response
Request
Path Parameters
pageId
optional
string
The page ID
Headers
Authorization
required
string
Access token using the Bearer method
Query Parameters
planId
optional
string
Filter the results by this Plan ID
limit
optional
integer
The number of rewards to return
from
optional
boolean
Offset the results to after the reward with this ID
Response
200: OK
Cake successfully retrieved.
{
"count": 3,
"_embedded": {
"rewards": [
{
"resource": "rewards",
"id": "6JGhzAiPD7jqlbYkdrg8",
"name": "Dit is een beloning",
"description": "Hallo daar!",
"type": "default",
"status": "enabled",
"_links": {
"self": {
"href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/rewards/6JGhzAiPD7jqlbYkdrg8",
"type": "application/hal+json"
},
"page": {
"href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB",
"type": "application/hal+json"
},
"plans": {
"href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/plans?rewardId=6JGhzAiPD7jqlbYkdrg8",
"type": "application/hal+json"
}
}
},
...
]
},
"_links": {
"self": {
"href": "https://api.petje.af/rewards",
"type": "application/hal+json"
},
"next": null
}
}

‚Äč

get
Get page reward detail

https://api.petje.af/v1/pages/:pageId/rewards/:id
Scope: pages.read
Request
Response
Request
Path Parameters
pageId
optional
string
The page ID
id
optional
string
The reward ID
Headers
Authorization
optional
string
Access token using the Bearer method
Response
200: OK
{
"resource": "rewards",
"id": "6JGhzAiPD7jqlbYkdrg8",
"name": "Dit is een beloning",
"description": "Hall daar!",
"type": "default",
"status": "enabled",
"_links": {
"self": {
"href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/rewards/6JGhzAiPD7jqlbYkdrg8",
"type": "application/hal+json"
},
"page": {
"href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB",
"type": "application/hal+json"
},
"plans": {
"href": "https://api.petje.af/pages/5SaEUOWD2b4dN7tJBKMB/plans?rewardId=6JGhzAiPD7jqlbYkdrg8",
"type": "application/hal+json"
}
}
}
404: Not Found
{
"status": 404,
"title": "Not Found",
"detail": "Page Reward is not found",
"_links": {
"documentation": {
"href": "https://docs.petje.af",
"type": "text/html"
}
}
}