REST API URL Thoughts

Users API

/api/users/v1/users/
GET - list all users
POST - create

/api/users/v1/users/{username}
GET - get specified user
PATCH - update specified user
DELETE - delete specified user

/api/users/v1/users/me
GET - get authenticated user

/api/users/v1/users/{username}/links
GET - list all linked accounts for the specified user
POST - create a linked account for the specified user

/api/users/v1/users/{username}/links/{link_id}
GET - get specified link
PATCH - update specified link
DELETE - delete specified link

Groups API

/api/users/v1/groups/
GET - list all groups
POST - create a group

/api/users/v1/groups/?username={username}
GET - get all groups for the specified user

/api/users/v1/groups/{group_id}
GET - get specified group
PATCH - update specified group
DELETE - delete specified group

/api/users/v1/groups/{group_id}/users
GET - list all users in the group
POST - add a user in the group

/api/users/v1/groups/{group_id}/users?username={username}
GET - get group information for the specified user and the specified group
PATCH - update group information for the specified user and the specified group
DELETE - delete the specified user from the specified group

Courses API

/api/courses/v1/courses/
GET - list all courses
POST - create a course

/api/courses/v1/courses/{course_id}
GET - get specified course
PATCH - update specified course
DELETE - delete specified course

/api/courses/v1/courses/{course_id}/reruns
GET - list all reruns of the specified course
POST - create a rerun of the specified course

Grades API

Copied from PR comment.

Grades Courses Resource

This is based on our current API conventions and how other existing edX APIs are designed.

/grades/v1/courses/              Courses grades for all users for all courses
  ?course_id={}&username={}        Course grade for filtered user(s) in filtered course(s)
  ?course_id={}                    Course grades for all users in filtered course(s)
  ?username={}                     Course grades for filtered user(s) in all their courses

/grades/v1/courses/{course_id}  Course grades for all users for a course
  ?username={}                     Course grade for filtered user(s) in a course 


Grades Users Resource

This is based on the desired need for a user-specific endpoint. We don't currently use this design pattern elsewhere in our system (other than for the user API itself). However, I do see us possibly supporting this pattern (in the future) for certain APIs to allow users and apps to easily get user-specific data without using a filtering API.

/grades/v1/users/me/courses        Course grades for authenticated user in all her courses

/grades/v1/users/{user_id}/courses Course grades for a user in all her courses
  ?course_id={}                      Course grades for a user in filtered course(s)

Grades Policy Resource

This is similar to the v0 Grades policy API, but follows the URI RFC by putting the course_id resource under a proper hierarchical container (courses).

/grades/v1/policy/courses/            Grading policy for all courses
  ?course_id={}                         Grading policy for filtered course(s)

/grades/v1/policy/courses/{course_id} Grading policy for a course