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