Trainer Rewards

    EndpointDescription
    GET /v1/trainers/rewardsGets a list of trainer rewards
    GET /v1/trainers/rewards/:trainer_idGets a trainer's reward
    POST /v1/trainers/rewards/:trainer_idUpdates a trainer's reward

    GET /v1/trainers/rewards

    Gets a list of trainer rewards

    Request Parameters

    None

    Example Request

    Header:

    GET /v1/trainers/rewards
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    

    Body:

    None

    Response Parameters

    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.

    Example Response

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

    GET /v1/trainers/rewards/:trainer_id

    Gets a trainer's reward

    Request Parameters

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

    Example Request

    Header:

    GET /v1/trainers/rewards/1
    Host: api.pkmnapi.com
    Authorization: Bearer <access_token>
    

    Body:

    None

    Response Parameters

    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.

    Example Response

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

    POST /v1/trainers/rewards/:trainer_id

    Updates a trainer's reward

    Request Parameters

    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.

    Example Request

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

    Response Parameters

    None

    Example Response

    Headers:

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

    Body:

    {}