-
Notifications
You must be signed in to change notification settings - Fork 1
Users Endpoints
N Vijay Narayanan edited this page Aug 16, 2022
·
12 revisions
GET: /api/users
- Authorization Required:
authorizeAdmin
Query Params | Description | Optional |
---|---|---|
cohortYear | Cohort year of the projects | false |
role | Users that are a specific role for the current specified cohort year (Returns all roles if unspecified) Valid Roles: ["Student", "Mentor", "Adviser"] | true |
page | Offset of the records to return (For pagination) | true |
limit | Limit of the records to return (For pagination) | true |
search | Query to search for users via the student names | true |
Response Body:
{
users: [
{
id: number;
name: string;
email: string;
profilePicUrl?: string;
githubUrl?: string;
linkedinUrl?: string;
personalSiteUrl?: string;
selfIntro?: string;
student: {
...
},
adviser: {
..
},
mentor: {
...
},
facilitator: {
...
},
}
]
}
GET: /api/users/lean
- Authorization Required:
authorizeAdmin
Query Params | Description | Optional |
---|---|---|
cohortYear | Cohort year of the projects (Returns users from all cohorts if unspecified) | true |
role | Users that are a specific role for the current specified cohort year (Returns users with any role if unspecified) | true |
excludeRole | Users of that role to exclude from the list | true |
Either provide:
- cohortYear and role
- cohortYear and excludeRole
Response Body:
{
users: [
{
name: string;
student: {
...
},
adviser: {
..
},
mentor: {
...
},
administrator: {
...
}
}
]
}
PUT: /api/users/:userId
- Authorization Required:
authorizeAdmin
ORauthorizeSelf
Request Body:
{
user: {
name?: string;
email?: string;
profilePicUrl?: string;
githubUrl?: string;
linkedinUrl?: string;
personalSiteUrl?: string;
selfIntro?: string;
}
}
PUT: /api/users/:role
- Authorization Required:
authorizeAdmin
Request Parameter: role: "Students" | "Advisers" | "Mentors" | "Administrators" (not optional)
Request Body:
{
cohortYear: number,
userIds: number[],
}
DELETE: /api/users/:userId
- Authorization Required:
authorizeAdmin
-
Auth Endpoints
/api/auth
-
Users Endpoints
/api/users
-
Students Endpoints
/api/students
-
Advisers Endpoints
/api/advisers
-
Mentors Endpoints
/api/mentors
-
Administrators Endpoints
/api/administrators
-
Cohorts Endpoints
/api/cohorts
-
Deadlines Endpoints
/api/deadlines
-
Projects Endpoints
/api/projects
-
Dashboard Endpoints
/api/dashboard
-
Evaluation Relationships Endpoints
/api/relations
-
Submissions Endpoints
/api/submissions
-
Announcements Endpoints
/api/announcements
-
Application Endpoints
/api/application
-
Vote Events Endpoints
/api/vote-events