Favorites API

A Favorite object looks like:

{
  // The ID of the object the Favorite refers to
  context_id: 1170,

  // The type of the object the Favorite refers to (currently, only "Course" is supported)
  context_type: "Course"
}
  

List favorite courses FavoritesController#list_favorite_courses

GET /api/v1/users/self/favorites/courses

Retrieve the list of favorite courses for the current user. If the user has not chosen any favorites, then a selection of currently enrolled courses will be returned.

See the List courses API for details on accepted include[] parameters.

Example Request:

curl https://<canvas>/api/v1/users/self/favorites/courses \ 
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
Returns a list of Courses

Add course to favorites FavoritesController#add_favorite_course

POST /api/v1/users/self/favorites/courses/:id

Add a course to the current user's favorites. If the course is already in the user's favorites, nothing happens.

must be registered in the course.

Request Parameters:

  • id

    the ID or SIS ID of the course to add. The current user

Example Request:

curl https://<canvas>/api/v1/users/self/favorites/courses/1170 \ 
  -X POST \ 
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \ 
  -H 'Content-Length: 0'
Returns a Favorite

Remove course from favorites FavoritesController#remove_favorite_course

DELETE /api/v1/users/self/favorites/courses/:id

Remove a course from the current user's favorites.

Request Parameters:

  • id

    the ID or SIS ID of the course to remove

Example Request:

curl https://<canvas>/api/v1/users/self/favorites/courses/1170 \ 
  -X DELETE \ 
  -H 'Authorization: Bearer <ACCESS_TOKEN>'
Returns a Favorite

Reset course favorites FavoritesController#reset_course_favorites

DELETE /api/v1/users/self/favorites/courses

Reset the current user's course favorites to the default automatically generated list of enrolled courses

Example Request:

curl https://<canvas>/api/v1/users/self/favorites/courses \ 
  -X DELETE \ 
  -H 'Authorization: Bearer <ACCESS_TOKEN>'