Endpoint | Description |
---|---|
GET /v1/trainers/rewards | Gets a list of trainer rewards |
GET /v1/trainers/rewards/:trainer_id | Gets a trainer's reward |
POST /v1/trainers/rewards/:trainer_id | Updates a trainer's reward |
Gets a list of trainer rewards
Header:
GET /v1/trainers/rewards
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Body:
None
Name | Type | Description |
---|---|---|
data
|
array | |
data[]
|
object | |
data[].id
|
string |
Trainer ID. (identical to :trainer_id )
|
data[].type
|
string | Type of resource. Must be "trainer_rewards". |
data[].attributes
|
object | |
data[].attributes.reward
|
number | Trainer reward. |
data[].links
|
object | |
data[].links.self
|
string | Link to current resource. |
links
|
object | |
links.self
|
string | Link to list resource. |
Headers:
HTTP/1.1 200 OK
Content-Type: application/json
Server: pkmnapi/0.1.0
Body:
{
"data": [
{
"id": "1",
"type": "trainer_rewards",
"attributes": {
"reward": 1500
},
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/rewards/1"
}
},
...
],
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/rewards"
}
}
Gets a trainer's reward
Location | Name | Type | Required? | Description |
---|---|---|---|---|
url |
:trainer_id
|
string | ✔️ | Trainer ID. |
Header:
GET /v1/trainers/rewards/1
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Body:
None
Name | Type | Description |
---|---|---|
data
|
object | |
data.id
|
string |
Trainer ID. (identical to :trainer_id )
|
data.type
|
string | Type of resource. Must be "trainer_rewards". |
data.attributes
|
object | |
data.attributes.reward
|
number | Trainer reward. |
data.links
|
object | |
data.links.self
|
string | Link to current resource. |
links
|
object | |
links.self
|
string | Link to current resource. |
Headers:
HTTP/1.1 200 OK
Content-Type: application/json
Server: pkmnapi/0.1.0
Body:
{
"data": {
"id": "1",
"type": "trainer_rewards",
"attributes": {
"reward": 1500
},
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/rewards/1"
}
},
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/rewards/1"
}
}
Updates a trainer's reward
Location | Name | Type | Required? | Description |
---|---|---|---|---|
url |
:trainer_id
|
string | ✔️ | Trainer ID. |
header |
X-Patch-Description
|
string | Description of change. | |
body |
data
|
object | ✔️ | |
body |
data.type
|
string | ✔️ | Type of data. Must be "trainer_rewards". |
body |
data.attributes
|
object | ✔️ | |
body |
data.attributes.reward
|
number | ✔️ | Trainer reward. |
Header:
POST /v1/trainers/rewards/1
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Content-Type: application/json
X-Patch-Description: Update YOUNGSTER's reward
Body:
{
"data": {
"type": "trainer_rewards",
"attributes": {
"reward": 1337
}
}
}
Headers:
HTTP/1.1 202 Accepted
Content-Type: application/json
Server: pkmnapi/0.1.0
Body:
{}