Skip to content

Users Endpoints

zechajw edited this page Jun 27, 2022 · 12 revisions

Get all users

GET: /api/users

  • Admin only
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: {
                ...
            },
        }
    ]
}

Update a user

PUT: /api/users/:userId

Request Body:

{
    user: {
        name?: string;
        email?: string;
        profilePicUrl?: string;
        githubUrl?: string;
        linkedinUrl?: string;
        personalSiteUrl?: string;
        selfIntro?: string;
    }
}

Delete a user

DELETE: /api/users/:userId

NUS Skylab v2 - Backend

Introduction

Project Organization

Project Requirements

Endpoints

Clone this wiki locally