Team Dev Frontend Server API (0.2.2)

Download OpenAPI specification:Download

user

Create user

Create new user

Request Body schema: application/json

User registration details

role
string
firstName
string
lastName
string
email
string
biography
string
githubUrl
string
profileUrl
string
password
string

Responses

Request samples

Content type
application/json
{
  • "role": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "biography": "string",
  • "githubUrl": "string",
  • "profileUrl": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Get all users by first name if provided

Authorizations:
bearerAuth
query Parameters
firstName
string

Search all users by first name if provided (case-sensitive and exact string matches only)

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Localhost Login

Request Body schema: application/json

User login information

email
string
password
string

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Get user by user id

Authorizations:
bearerAuth
path Parameters
id
required
string

The name that needs to be fetched. Use user1 for testing.

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Update the cohort to which this user belongs

Only users with a TEACHER role can call this endpoint.

Authorizations:
bearerAuth
path Parameters
id
required
string

The user id that needs to be updated

Request Body schema: application/json

Cohort Id to add user to

cohortId
integer

Responses

Request samples

Content type
application/json
{
  • "cohortId": 0
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Update the profile of this user

Updates the profile of this user. Only teachers can update cohortId or role. Users with Students role can only update their own profile.

Authorizations:
bearerAuth
path Parameters
id
required
string

The user id that needs to be updated

Request Body schema: application/json

The profile info

email
string
password
string
cohortId
integer
role
string
object

Responses

Request samples

Content type
application/json
{
  • "email": "string",
  • "password": "string",
  • "cohortId": 0,
  • "role": "string",
  • "profile": {
    }
}

Response samples

Content type
application/json
{
  • "role": "string",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "biography": "string",
  • "githubUrl": "string",
  • "profileUrl": "string",
  • "password": "string"
}

post

Create post

This can only be done by the logged in user.

Authorizations:
bearerAuth
Request Body schema: application/json

Created post object

content
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Get all posts

get all posts

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": [
    ]
}

Get all post likes

get all post likes

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status:security": null,
  • "data": {
    }
}

Like a post

This can only be done by the logged in user.

Authorizations:
bearerAuth
path Parameters
id
required
any

The id of the post that is being liked.

Request Body schema: application/json

Like (or not) a post

active
boolean
postLikeId
integer or null

Responses

Request samples

Content type
application/json
{
  • "active": true,
  • "postLikeId": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "userId": 0,
  • "postId": 0,
  • "createdAt": "string",
  • "updatedAt": "string",
  • "active": true
}

Edit a post

edit post by id

Authorizations:
bearerAuth
path Parameters
id
required
string

The id of the post that is being edited.

Request Body schema: application/json

content to edit

content
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Delete a post by id

delete post by id

Authorizations:
bearerAuth
path Parameters
id
required
string

get post by its id

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

cohort

Get all cohorts

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": [
    ]
}

Create cohort

This can only be done by the logged in user with role TEACHER.

Authorizations:
bearerAuth
Request Body schema: application/json

Cohort details

cohortName
string
startDate
string
endDate
string

Responses

Request samples

Content type
application/json
{
  • "cohortName": "string",
  • "startDate": "string",
  • "endDate": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

log

Create delivery log

This can only be done by authorised teacher user.

Authorizations:
bearerAuth
Request Body schema: application/json

Created log object

date
string
cohortId
integer
Array of objects

Responses

Request samples

Content type
application/json
{
  • "date": "string",
  • "cohortId": 0,
  • "lines": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

note

Create note for a student

This can only be done by a logged in TEACHER.

Authorizations:
bearerAuth
path Parameters
studentId
required
integer
Request Body schema: application/json

Created note object

content
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "content": "string",
  • "teacherId": 0,
  • "studentId": 0,
  • "isEdited": true,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Get all notes for a student

get all notes

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Edit a note

edit bote by id

Authorizations:
bearerAuth
path Parameters
id
required
string

The id of the note that is being edited.

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Delete a note by id

delete note by id

Authorizations:
bearerAuth
path Parameters
id
required
string

get note by its id

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

conversation

Create conversation

This can only be done by a logged in user

Authorizations:
bearerAuth
Request Body schema: application/json

Created conversation object

content
any

Responses

Request samples

Content type
application/json
{
  • "content": null
}

Response samples

Content type
application/json
{
  • "userIds": 0,
  • "name": "string"
}

Get all conversations

get all conversations

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "userIds": 0,
  • "name": "string"
}

Get conversation by user id

Authorizations:
bearerAuth
path Parameters
id
required
int

The id of the user for which we need to fetch conversations

Responses

Response samples

Content type
application/json
{
  • "userIds": 0,
  • "name": "string"
}

exercise

Create exercise

Create new exercise

Authorizations:
bearerAuth
Request Body schema: application/json

Exercise details

exerciseName
string
githubUrl
string
unitId
integer or null

Responses

Request samples

Content type
application/json
{
  • "exerciseName": "string",
  • "githubUrl": "string",
  • "unitId": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "exerciseName": "string",
  • "githubUrl": "string",
  • "unitId": 0
}

Get all exercises

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Get exercise by exercise id

Authorizations:
bearerAuth
path Parameters
id
required
string

The exercise id that needs to be fetched.

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Create cohort exercise

Create new cohort exercise

Authorizations:
bearerAuth
path Parameters
id
required
integer

The cohort id for which an exercise needs assigning

Request Body schema: application/json

Cohort exercise details

exerciseId
integer

Responses

Request samples

Content type
application/json
{
  • "exerciseId": 0
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "exerciseId": 0,
  • "cohortId": 0
}

Get all cohort exercise by cohort id

Authorizations:
bearerAuth
path Parameters
id
required
string

The cohort id for which exercises are fetched

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

comment

Comment on a post

comment a post by id

Authorizations:
bearerAuth
path Parameters
id
required
integer

get post by its id

Request Body schema: application/json

Created post object

content
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Delete a comment by id

by a logged in user who owns the post or the comment, or with the role of TEACHER

Authorizations:
bearerAuth
path Parameters
postId
required
integer

id of the post which has the comment to delete

commentId
required
integer

id of the comment to delete

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Edit a comment by id

by a logged in user who owns the comment

Authorizations:
bearerAuth
path Parameters
postId
required
integer

id of the post which has the comment to delete

commentId
required
integer

id of the comment to delete

Request Body schema: application/json

content to edit

content
string

Responses

Request samples

Content type
application/json
{
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Get all comment likes

get all comment likes

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
{
  • "status": "string",
  • "data": {
    }
}

Like a comment by id

This can be done by any logged in user.

Authorizations:
bearerAuth
path Parameters
postId
required
integer
commentId
required
integer
Request Body schema: application/json

Like (or not) a post

active
boolean
commentLikeId
integer or null

Responses

Request samples

Content type
application/json
{
  • "active": true,
  • "commentLikeId": 0
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}

Delete a comment like

This can be done by a logged in user who liked a particular comment

Authorizations:
bearerAuth
path Parameters
postId
required
integer
commentId
required
integer

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "data": {
    }
}