Endpoint | Description |
---|---|
GET /v1/types/names | Gets a list of type names |
GET /v1/types/names/:type_id | Gets a type name |
POST /v1/types/names/:type_id | Updates a type name |
Gets a list of type names
Header:
GET /v1/types/names
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Body:
None
Name | Type | Description |
---|---|---|
data
|
array | |
data[]
|
object | |
data[].id
|
string |
Type ID. (identical to :type_id )
|
data[].type
|
string | Type of resource. Must be "type_names". |
data[].attributes
|
object | |
data[].attributes.name
|
string | Type 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": "0",
"type": "type_names",
"attributes": {
"name": "NORMAL"
},
"links": {
"self": "https://api.pkmnapi.com/v1/types/names/0"
}
},
...
],
"links": {
"self": "https://api.pkmnapi.com/v1/types/names"
}
}
Gets a type name
Location | Name | Type | Required? | Description |
---|---|---|---|---|
url |
:type_id
|
string | ✔️ | Type ID. |
Header:
GET /v1/types/names/0
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Body:
None
Name | Type | Description |
---|---|---|
data
|
object | |
data.id
|
string |
Type ID. (identical to :type_id )
|
data.type
|
string | Type of resource. Must be "type_names". |
data.attributes
|
object | |
data.attributes.name
|
string | Type 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": "0",
"type": "type_names",
"attributes": {
"name": "NORMAL"
},
"links": {
"self": "https://api.pkmnapi.com/v1/types/names/0"
}
},
"links": {
"self": "https://api.pkmnapi.com/v1/types/names/0"
}
}
Updates a type
Location | Name | Type | Required? | Description |
---|---|---|---|---|
url |
:type_id
|
string | ✔️ | Type ID. |
header |
X-Patch-Description
|
string | Description of change. | |
body |
data
|
object | ✔️ | |
body |
data.type
|
string | ✔️ | Type of data. Must be "type_names". |
body |
data.attributes
|
object | ✔️ | |
body |
data.attributes.name
|
string | ✔️ | Type name. |
Header:
POST /v1/types/names/0
Host: api.pkmnapi.com
Authorization: Bearer <access_token>
Content-Type: application/json
X-Patch-Description: Update NORMAL type
Body:
{
"data": {
"type": "type_names",
"attributes": {
"name": "BORING"
}
}
}
Headers:
HTTP/1.1 202 Accepted
Content-Type: application/json
Server: pkmnapi/0.1.0
Body:
{}