Skip to content

Characters

Henrique Tedeschi edited this page May 31, 2020 · 1 revision

Overview

For this section, you will find all information to use characters.

Usage

Token and Headers

Make sure you have included the Authorization header with your token to use the API properly. To request a Token go to parksandrecapi.com and follow the steps to request one.

Header Required Values/Examples
Authorization Required Bearer {token}

Endpoints

Method Endpoint
GET /api/v1/characters
GET /api/v1/characters/{name}
GET /api/v1/bandnames/ping

[GET] api/v1/characters

When reaching this endpoint, the response will be like this:

[
    {
        "name": "Leslie Knope",
        "portrayed": "Amy Poehler",
        "background": "Knope was born on January 18, 1975 (S4: E3) in Eagleton, ...",
        "personality": "Leslie Knope is extremely cheerful, ambitious, hard-working and optimistic",
        "__v": 0
    },
    {
        "name": "Ann Perkins",
        "portrayed": "Rashida Jones",
        "background": "At the start of the series, Ann Perkins was living with her boyfriend Andy Dwyer. ...",
        "personality": "",
        "__v": 0
    },
    ...
]

[GET] api/v1/characters/{name}

Parameters to be included:

Parameter Type Required Example
name string optional ron

When reaching this endpoint, the response will be like this:

[
    {
        "name": "Ron Swanson",
        "portrayed": "Nick Offerman",
        "background": "Despite Ron being a very private person, including getting his birthdate redacted from all public documents, ...",
        "personality": "",
        "__v": 0
    }
]

[GET] api/v1/characters/ping

When reaching this endpoint, the response will be like this:

{
    "success": true,
    "date": "2020-05-31T19:31:15.522Z"
}