Endpoint | Description |
---|---|
GET /v1/trainers/names | Gets a list of trainer names |
GET /v1/trainers/names/:trainer_id | Gets a trainer's name |
POST /v1/trainers/names/:trainer_id | Updates a trainer's name |
Gets a list of trainer names
Header:
GET /v1/trainers/names
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_names". |
data[].attributes
|
object | |
data[].attributes.name
|
string | Trainer name. |
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_names",
"attributes": {
"name": "YOUNGSTER"
},
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/names/1"
}
},
...
],
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/names"
}
}
Gets a trainer's name
Location | Name | Type | Required? | Description |
---|---|---|---|---|
url |
:trainer_id
|
string | ✔️ | Trainer ID. |
Header:
GET /v1/trainers/names/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_names". |
data.attributes
|
object | |
data.attributes.name
|
string | Trainer name. |
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_names",
"attributes": {
"name": "YOUNGSTER"
},
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/names/1"
}
},
"links": {
"self": "https://api.pkmnapi.com/v1/trainers/names/1"
}
}
Updates a trainer's name
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_names". |
body |
data.attributes
|
object | ✔️ | |
body |
data.attributes.name
|
string | ✔️ | Trainer name. |
Header:
POST /v1/trainers/names/1
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Content-Type: application/json
X-Patch-Description: Update YOUNGSTER to OLD-TIMER
Body:
{
"data": {
"type": "trainer_names",
"attributes": {
"name": "OLD-TIMER"
}
}
}
Headers:
HTTP/1.1 202 Accepted
Content-Type: application/json
Server: pkmnapi/0.1.0
Body:
{}