User Operations on the Category

Learn how to perform some important operations on categories using the Vimeo API.

In this lesson, we'll learn about a few user-related operations on a category:

  • Check if a user follows a specific category

  • Allow a user to follow a specific category

  • Allow a user to unfollow a specific category

  • Get all the categories that a user follows

We’ll use the following endpoints to perform these operations:

  • We’ll use the {base_url}/users/{userID}/categories/{categoryName} endpoint to check, follow, and unfollow a category. These three functionalities are specified by the type of HTTP method.

  • We’ll use the {base_url}/users/{userID}/categories endpoint to get all categories followed by a user.

Check if a user follows a category

In this section, we'll go over an operation that we perform with the users/{userID}/categories/{categoryName} endpoint. Here userID is the unique identifier of the authenticated user, which is your ID.

When we make an HTTP GET request to this endpoint, it checks if the user associated with userID has followed the category defined by categoryName. It doesn’t take body or query parameters, but userID and categoryName are required path parameters.

Let's see the functionality of the GET request in the code widget below:

Get hands-on with 1400+ tech skills courses.