Type Names

    EndpointDescription
    GET /v1/types/namesGets a list of type names
    GET /v1/types/names/:type_idGets a type name
    POST /v1/types/names/:type_idUpdates a type name

    GET /v1/types/names

    Gets a list of type names

    Request Parameters

    None

    Example Request

    Header:

    GET /v1/types/names
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    

    Body:

    None

    Response Parameters

    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.

    Example Response

    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"
        }
    }
    

    GET /v1/types/names/:type_id

    Gets a type name

    Request Parameters

    Location Name Type Required? Description
    url :type_id string ✔️ Type ID.

    Example Request

    Header:

    GET /v1/types/names/0
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    

    Body:

    None

    Response Parameters

    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.

    Example Response

    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"
        }
    }
    

    POST /v1/types/names/:type_id

    Updates a type

    Request Parameters

    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.

    Example Request

    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"
            }
        }
    }
    

    Response Parameters

    None

    Example Response

    Headers:

    HTTP/1.1 202 Accepted
    Content-Type: application/json
    Server: pkmnapi/0.1.0
    

    Body:

    {}