{
  "openapi": "3.0.1",
  "info": {
    "title": "Hubhopper Partner Integration API(s) - Production",
    "description": "This is an interactive document explaining the API(s) that could be used to fetch data from [Hubhopper](https://hubhopper.com). Use the api key provided to authorize `x-api-key` and test the API(s). The output data models are also available for reference.",
    "version": "v5"
  },
  "servers": [
    {
      "url": "https://apis.hubhopper.com/partner"
    }
  ],
  "tags": [
    {
      "name": "Category",
      "description": "API(s) related to Categories."
    },
    {
      "name": "Podcast",
      "description": "API(s) related to Podcasts and Episodes."
    },
    {
      "name": "Util",
      "description": "API(s) related to Content Utility on Hubhopper."
    }
  ],
  "paths": {
    "/categories": {
      "get": {
        "tags": [
          "Category"
        ],
        "description": "Get the list of all content categories.",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Provide the size of the page to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Provide the page number to fetch.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryList"
                }
              }
            }
          },
          "404": {
            "description": "404 response"
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    },
    "/categories/{categoryId}": {
      "get": {
        "tags": [
          "Category"
        ],
        "description": "Get specific content category.",
        "parameters": [
          {
            "name": "categoryId",
            "in": "path",
            "description": "Unique qualifier for a category.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SingleCategory"
                }
              }
            }
          },
          "404": {
            "description": "404 response"
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    },
    "/categories/{categoryId}/podcasts": {
      "get": {
        "tags": [
          "Category"
        ],
        "description": "Get a list of all podcasts under a category.",
        "parameters": [
          {
            "name": "categoryId",
            "in": "path",
            "description": "Unique qualifier for a category.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Provide the page number to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Provide the size of the page to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Order the items by 'newest' | 'random'",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Takes filters like 'lang' in a url encoded json. \nExample:\n1)Single ->\n&nbsp;&nbsp;&nbsp;&nbsp; var filterJson = {\"lang\":[\"en\"]};\n&nbsp;&nbsp;&nbsp;&nbsp; var url = baseUrl+'?'+filters=enocdeURI(JSON.stringify(filterJson));\n2)Multiple ->\n&nbsp;&nbsp;&nbsp;&nbsp; var filterJson = {\"lang\":[\"en\",\"hi\"]};\n&nbsp;&nbsp;&nbsp;&nbsp; var url = baseUrl+'?'+filters=enocdeURI(JSON.stringify(filterJson));",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PodcastList"
                }
              }
            }
          },
          "404": {
            "description": "404 response"
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    },
    "/podcasts": {
      "get": {
        "tags": [
          "Podcast"
        ],
        "description": "Get the list of all podcasts.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Provide the page number to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Provide the size of the page to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Order the items by 'newest' | 'random'",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Takes filters like 'lang' in a url encoded json. \nExample:\n1)Single ->\n&nbsp;&nbsp;&nbsp;&nbsp; var filterJson = {\"lang\":[\"en\"]};\n&nbsp;&nbsp;&nbsp;&nbsp; var url = baseUrl+'?'+filters=enocdeURI(JSON.stringify(filterJson));\n2)Multiple ->\n&nbsp;&nbsp;&nbsp;&nbsp; var filterJson = {\"lang\":[\"en\",\"hi\"]};\n&nbsp;&nbsp;&nbsp;&nbsp; var url = baseUrl+'?'+filters=enocdeURI(JSON.stringify(filterJson));",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PodcastList"
                }
              }
            }
          },
          "404": {
            "description": "404 response"
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    },
    "/podcasts/{podcastId}": {
      "get": {
        "tags": [
          "Podcast"
        ],
        "description": "Get a single Podcast.",
        "parameters": [
          {
            "name": "podcastId",
            "in": "path",
            "description": "Unique qualifier for a podcast.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SinglePodcast"
                }
              }
            }
          },
          "404": {
            "description": "404 response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    },
    "/podcasts/{podcastId}/episodes": {
      "get": {
        "tags": [
          "Podcast"
        ],
        "description": "Get a list of all episodes under a podcast.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Provide the page number to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Provide the size of the page to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Order the items by 'newest' | 'random'",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filters",
            "in": "query",
            "description": "Takes filters like 'lang' in a url encoded json. \nExample:\n1)Single ->\n&nbsp;&nbsp;&nbsp;&nbsp; var filterJson = {\"lang\":[\"en\"]};\n&nbsp;&nbsp;&nbsp;&nbsp; var url = baseUrl+'?'+filters=enocdeURI(JSON.stringify(filterJson));\n2)Multiple ->\n&nbsp;&nbsp;&nbsp;&nbsp; var filterJson = {\"lang\":[\"en\",\"hi\"]};\n&nbsp;&nbsp;&nbsp;&nbsp; var url = baseUrl+'?'+filters=enocdeURI(JSON.stringify(filterJson));",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "podcastId",
            "in": "path",
            "description": "Unique qualifier for a podcast.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "headers": {
              "Access-Control-Allow-Origin": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PodcastEpisodeList"
                }
              }
            }
          },
          "404": {
            "description": "404 response"
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    },
    "/util/languages": {
      "get": {
        "tags": [
          "Util"
        ],
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Provide the size of the page to fetch.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Provide the page number to fetch.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LanguageList"
                }
              }
            }
          },
          "204": {
            "description": "204 response"
          },
          "401": {
            "description": "401 response"
          },
          "404": {
            "description": "404 response"
          },
          "500": {
            "description": "500 response"
          }
        },
        "security": [
          {
            "api_key": null,
            "partner_id": null
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "CategoryList": {
        "title": "CategoryListOutputModel",
        "type": "object",
        "properties": {
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CategoryListCategoriesItem"
            }
          },
          "noOfPages": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "CategoryListCategoriesItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "Empty": {
        "title": "Empty Schema",
        "type": "object"
      },
      "Error": {
        "title": "Error Schema",
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          }
        }
      },
      "LanguageItem": {
        "title": "LanguageItem",
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "LanguageList": {
        "title": "LanguageList",
        "type": "object",
        "properties": {
          "languages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LanguageItem"
            }
          },
          "noOfPages": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "PodcastEpisodeList": {
        "title": "PodcastEpisodeListOutputModel",
        "type": "object",
        "properties": {
          "episodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PodcastEpisodeListEpisodesItem"
            }
          },
          "noOfPages": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "PodcastEpisodeListEpisodesItem": {
        "type": "object",
        "properties": {
          "author": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "episodeId": {
            "type": "integer"
          },
          "episodeUrl": {
            "type": "string"
          },
          "image": {
            "type": "string"
          },
          "isNew": {
            "type": "boolean"
          },
          "play": {
            "type": "object",
            "properties": {
              "duration": {
                "type": "string"
              },
              "durationInSec": {
                "type": "integer"
              },
              "size": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "url": {
                "type": "string"
              }
            }
          },
          "podcastId": {
            "type": "integer"
          },
          "podcastUrl": {
            "type": "string"
          },
          "publishTime": {
            "type": "string"
          },
          "publishedOn": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          }
        }
      },
      "PodcastList": {
        "title": "PodcastListOutputModel",
        "type": "object",
        "properties": {
          "noOfPages": {
            "type": "integer"
          },
          "page": {
            "type": "integer"
          },
          "pageSize": {
            "type": "integer"
          },
          "podcasts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PodcastListPodcastsItem"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "PodcastListPodcastsItem": {
        "type": "object",
        "properties": {
          "author": {
            "type": "string"
          },
          "category": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "categoryId": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "episodes": {
            "type": "integer"
          },
          "featured": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "featuredId": {
            "type": "integer"
          },
          "image": {
            "type": "string"
          },
          "keywords": {
            "type": "string"
          },
          "latestEpisodeTime": {
            "type": "string"
          },
          "podcastId": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "SingleCategory": {
        "title": "SingleCategoryOutputModel",
        "type": "object",
        "properties": {
          "category": {
            "$ref": "#/components/schemas/SingleCategoryCategory"
          }
        },
        "description": "Model to fetch a single category."
      },
      "SingleCategoryCategory": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "SinglePodcast": {
        "title": "SinglePodcastOutputModel",
        "type": "object",
        "properties": {
          "podcast": {
            "$ref": "#/components/schemas/SinglePodcastPodcast"
          }
        }
      },
      "SinglePodcastPodcast": {
        "type": "object",
        "properties": {
          "author": {
            "type": "string"
          },
          "category": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "categoryId": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "episodes": {
            "type": "integer"
          },
          "featured": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "featuredId": {
            "type": "integer"
          },
          "image": {
            "type": "string"
          },
          "keywords": {
            "type": "string"
          },
          "latest_episode_time": {
            "type": "string"
          },
          "podcastId": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "website": {
            "type": "string"
          }
        }
      }
    },
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      },
      "partner_id": {
        "type": "apiKey",
        "name": "hhPartnerId",
        "in": "header"
      }
    }
  }
}