Download OpenAPI specification:Download
Create new user
User registration details
role | string |
firstName | string |
lastName | string |
string | |
biography | string |
githubUrl | string |
profileUrl | string |
password | string |
{- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "biography": "string",
- "githubUrl": "string",
- "profileUrl": "string",
- "password": "string"
}
{- "status": "success",
- "data": {
- "token": "string",
- "user": {
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "biography": "string",
- "email": "string",
- "githubUrl": "string",
- "profileUrl": "string"
}
}
}
firstName | string Search all users by first name if provided (case-sensitive and exact string matches only) |
{- "status": "string",
- "data": {
- "users": [
- {
- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "biography": "string",
- "githubUrl": "string",
- "profileUrl": "string",
- "password": "string"
}
]
}
}
User login information
string | |
password | string |
{- "email": "string",
- "password": "string"
}
{- "status": "string",
- "data": {
- "token": "string",
- "user": {
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "biography": "string",
- "githubUrl": "string"
}
}
}
id required | string The name that needs to be fetched. Use user1 for testing. |
{- "status": "string",
- "data": {
- "user": {
- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "biography": "string",
- "githubUrl": "string",
- "profileUrl": "string",
- "password": "string"
}
}
}
Only users with a TEACHER role can call this endpoint.
id required | string The user id that needs to be updated |
Cohort Id to add user to
cohortId | integer |
{- "cohortId": 0
}
{- "status": "string",
- "data": {
- "user": {
- "cohortId": 0
}
}
}
Updates the profile of this user. Only teachers can update cohortId or role. Users with Students role can only update their own profile.
id required | string The user id that needs to be updated |
The profile info
string | |
password | string |
cohortId | integer |
role | string |
object |
{- "email": "string",
- "password": "string",
- "cohortId": 0,
- "role": "string",
- "profile": {
- "update": {
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileUrl": "string"
}
}
}
{- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "biography": "string",
- "githubUrl": "string",
- "profileUrl": "string",
- "password": "string"
}
This can only be done by the logged in user.
Created post object
content | string |
{- "content": "string"
}
{- "status": "string",
- "data": {
- "post": {
- "id": 0,
- "content": "string"
}
}
}
{- "status": "string",
- "data": [
- {
- "id": 0,
- "content": "string",
- "userId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "user": {
- "email": "string",
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "profile": {
- "id": 0,
- "userId": 0,
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileImageUrl": "string"
}
}, - "likes": [
- {
- "userId": 0,
- "postId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "user": {
- "email": "string",
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "profile": {
- "id": 0,
- "userId": 0,
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileImageUrl": "string"
}
}
}
], - "comments": [
- {
- "id": 0,
- "content": "string",
- "userId": 0,
- "postId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "user": {
- "email": "string",
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "profile": {
- "id": 0,
- "userId": 0,
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileImageUrl": "string"
}
}, - "likes": [
- {
- "userId": 0,
- "postId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "user": {
- "email": "string",
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "profile": {
- "id": 0,
- "userId": 0,
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileImageUrl": "string"
}
}
}
]
}
]
}
]
}
This can only be done by the logged in user.
id required | any The id of the post that is being liked. |
Like (or not) a post
active | boolean |
postLikeId | integer or null |
{- "active": true,
- "postLikeId": 0
}
{- "id": 0,
- "userId": 0,
- "postId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "active": true
}
edit post by id
id required | string The id of the post that is being edited. |
content to edit
content | string |
{- "content": "string"
}
{- "status": "string",
- "data": {
- "error": "string"
}
}
delete post by id
id required | string get post by its id |
{- "status": "string",
- "data": {
- "deletedPost": {
- "id": 0,
- "content": "string",
- "userId": 0,
- "createdAt": "string",
- "updatedAt": "string"
}, - "deletedComments": {
- "count": 0
}
}
}
This can only be done by the logged in user with role TEACHER.
Cohort details
cohortName | string |
startDate | string |
endDate | string |
{- "cohortName": "string",
- "startDate": "string",
- "endDate": "string"
}
{- "status": "string",
- "data": {
- "cohort": {
- "id": 0,
- "cohortName": "string",
- "startDate": "string",
- "endDate": "string"
}
}
}
This can only be done by authorised teacher user.
Created log object
date | string |
cohortId | integer |
Array of objects |
{- "date": "string",
- "cohortId": 0,
- "lines": [
- {
- "content": "string"
}
]
}
{- "status": "string",
- "data": {
- "log": {
- "id": 0,
- "cohortId": 0,
- "date": "string",
- "author": {
- "id": 0,
- "firstName": "string",
- "lastName": "string"
}, - "lines": [
- {
- "id": 0,
- "content": "string"
}
]
}
}
}
This can only be done by a logged in TEACHER.
studentId required | integer |
Created note object
content | string |
{- "content": "string"
}
{- "id": 0,
- "content": "string",
- "teacherId": 0,
- "studentId": 0,
- "isEdited": true,
- "createdAt": "string",
- "updatedAt": "string"
}
This can only be done by a logged in user
Created conversation object
content | any |
{- "content": null
}
{- "userIds": 0,
- "name": "string"
}
Create new exercise
Exercise details
exerciseName | string |
githubUrl | string |
unitId | integer or null |
{- "exerciseName": "string",
- "githubUrl": "string",
- "unitId": 0
}
{- "id": 0,
- "exerciseName": "string",
- "githubUrl": "string",
- "unitId": 0
}
{- "status": "string",
- "data": {
- "users": [
- {
- "role": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "biography": "string",
- "githubUrl": "string",
- "profileUrl": "string",
- "password": "string"
}
]
}
}
id required | string The exercise id that needs to be fetched. |
{- "status": "string",
- "data": {
- "exercise": {
- "id": 0,
- "exerciseName": "string",
- "githubUrl": "string",
- "unitId": 0
}
}
}
Create new cohort exercise
id required | integer The cohort id for which an exercise needs assigning |
Cohort exercise details
exerciseId | integer |
{- "exerciseId": 0
}
{- "id": 0,
- "exerciseId": 0,
- "cohortId": 0
}
comment a post by id
id required | integer get post by its id |
Created post object
content | string |
{- "content": "string"
}
{- "status": "string",
- "data": {
- "post": {
- "id": 0,
- "content": "string",
- "userId": 0,
- "postId": 0,
- "parentId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "user": {
- "email": "string",
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "profile": {
- "id": 0,
- "userId": 0,
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileImageUrl": "string"
}
}
}
}
}
by a logged in user who owns the post or the comment, or with the role of TEACHER
postId required | integer id of the post which has the comment to delete |
commentId required | integer id of the comment to delete |
{- "status": "string",
- "data": {
- "deletedPost": {
- "id": 0,
- "content": "string",
- "userId": 0,
- "createdAt": "string",
- "updatedAt": "string"
}, - "deletedComments": {
- "count": 0
}
}
}
by a logged in user who owns the comment
postId required | integer id of the post which has the comment to delete |
commentId required | integer id of the comment to delete |
content to edit
content | string |
{- "content": "string"
}
{- "status": "string",
- "data": {
- "post": {
- "id": 0,
- "content": "string",
- "userId": 0,
- "postId": 0,
- "parentId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "user": {
- "email": "string",
- "id": 0,
- "cohortId": 0,
- "role": "string",
- "profile": {
- "id": 0,
- "userId": 0,
- "firstName": "string",
- "lastName": "string",
- "bio": "string",
- "githubUrl": "string",
- "profileImageUrl": "string"
}
}
}
}
}
This can be done by any logged in user.
postId required | integer |
commentId required | integer |
Like (or not) a post
active | boolean |
commentLikeId | integer or null |
{- "active": true,
- "commentLikeId": 0
}
{- "status": "success",
- "data": {
- "like": {
- "userId": 0,
- "commentId": 0,
- "createdAt": "string",
- "updatedAt": "string",
- "active": true
}
}
}
This can be done by a logged in user who liked a particular comment
postId required | integer |
commentId required | integer |
{- "status": "success",
- "data": {
- "like": {
- "userId": 1,
- "commentId": 1
}
}
}