Skip to content

Episodes

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

Overview

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

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/episodes
GET /api/v1/episodes/{title}
GET /api/v1/episodes/ping

[GET] api/v1/episodes

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

[
    {
        "season": "1",
        "number_overall": 1,
        "number_season": 1,
        "title": "Pilot",
        "directed_by": "Greg Daniels",
        "written_by": "Greg Daniels & Michael Schur",
        "air_date": "2009-04-09T06:00:00.000Z",
        "viewers": 6770000
    },
    {
        "season": "1",
        "number_overall": 2,
        "number_season": 2,
        "title": "Canvassing",
        "directed_by": "Seth Gordon",
        "written_by": "Rachel Axler",
        "air_date": "2009-04-16T06:00:00.000Z",
        "viewers": 5920000
    },
    ...
]

[GET] api/v1/episodes/{title}

Parameters to be included:

Parameter Type Required Example
title string optional knope

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

[
    {
        "season": "4",
        "number_overall": 47,
        "number_season": 1,
        "title": "I'm Leslie Knope",
        "directed_by": "Troy Miller",
        "written_by": "Dan Goor",
        "air_date": "2011-09-22T06:00:00.000Z",
        "viewers": 4110000
    },
    {
        "season": "4",
        "number_overall": 55,
        "number_season": 9,
        "title": "The Trial of Leslie Knope",
        "directed_by": "Dean Holland",
        "written_by": "Dan Goor & Michael Schur",
        "air_date": "2011-12-01T07:00:00.000Z",
        "viewers": 3690000
    },
    ...
]

[GET] api/v1/characters/ping

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

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