JSON REST API – version 2 – Categories

Note: The version 2 API does not authenticate using a Connect user’s username and password using HTTP BASIC AUTH. Instead you create a client application using Connect’s web user interface. The client application is issued an ACCESS KEY and SECRET PASSPHRASE. These values must be passed in custom header values on every request.

 

URLs

Method URL Content Type
GET https://connect.telvue.com/api/v2/categories application/json
GET https://connect.telvue.com/api/v2/categories/:id application/json

Authentication

Type Credentials Required
Connect Custom Connect Issued Access Key and Secret Passphrase

Examples

Using your favorite HTTP tool or library, make a GET request to https://connect.telvue.com/api/v2/categories/:id replace :id with the id of the Connect Category being requested and include Access Key and Secret Passphrase for the Client Application from which you are making the request.

cURL

The popular cURL tool comes bundled with any Linux, Mac, or UNIX operating system, and there are Windows equivalents.

Example cURL GET Categories Index Request:

curl -k --header "CONNECT-ACCESS-KEY: mykey" \
--header "CONNECT-SECRET-PASSPHRASE: mysecretpassphrase" \
https://connect.telvue.com/api/v2/categories.json

Example JSON Response:

{
  "categories":
    [
      {
        "id":29,
        "full_name":"film",
        "name":"film",
        "root_category":true,
        "default":false,
        "organization_id":13,
        "parent_id":null,
        "child_ids":[31],
        "thumbnail_large":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/hd_e7a8d120-4451-0133-9d1e-0001a4a2b434.jpg",
        "thumbnail_tiny":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/sd_e7a8d120-4451-0133-9d1e-0001a4a2b434.jpg",
        "playables_count":1
      },
      {
        "id":31,
        "full_name":"film/drama",
        "name":"drama",
        "root_category":false,
        "default":true,
        "organization_id":13,
        "parent_id":29,
        "child_ids":[90],
        "thumbnail_large":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/hd_009ae54b-d4da-4088-9930-76ccf12dfdcc.jpg",
        "thumbnail_tiny":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/sd_009ae54b-d4da-4088-9930-76ccf12dfdcc.jpg",
        "playables_count":1
      },
      {
        "id":90,
        "full_name":"film/drama/award winners",
        "name":"award winners",
        "root_category":false,
        "default":false,
        "organization_id":13,
        "parent_id":31,
        "child_ids":[],
        "thumbnail_large":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/hd_001765a4-b8c6-4e68-979c-7368e58444bf.jpg",
        "thumbnail_tiny":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/sd_001765a4-b8c6-4e68-979c-7368e58444bf.jpg",
        "playables_count":1
      }
    ]
}

Example cURL GET Category Request:

curl -k --header "CONNECT-ACCESS-KEY: mykey" \
--header "CONNECT-SECRET-PASSPHRASE: mysecretpassphrase" \
--header "Content-Type: application/json" \
https://connect.telvue.com/api/v2/categories/31.json

Example JSON Response:

{
  "category":
    {
      "id":31,
      "full_name":"film/drama",
      "name":"drama",
      "root_category":false,
      "default":true,
      "organization_id":13,
      "parent_id":29,
      "child_ids":[91,90],
      "thumbnail_large":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/hd_009ae54b-d4da-4088-9930-76ccf12dfdcc.jpg",
      "thumbnail_tiny":"https://connect.telvue.com/alternate_assets/ae9b0680-0b93-0133-e301-52540084dd42/category_images/sd_009ae54b-d4da-4088-9930-76ccf12dfdcc.jpg",
      "playables_count":1
    }
}

in Connect APIs

Related Articles