Course Wright API (0.1.0-pre)

Download OpenAPI specification:Download

Documentation for the Course Wright API

Unprotected

Create an Account

Create a new account

Request Body schema:
firstName
required
string
lastName
required
string
email
required
string
password
required
string
repeatPassword
required
string

Responses

Request samples

Content type
{
  • "firstName": "string",
  • "lastName": "string",
  • "email": "string",
  • "password": "string",
  • "repeatPassword": "string"
}

Sign In

Sign into an account and recieve a jwt back along with a refresh token

Request Body schema: application/json
email
required
string
password
required
string

Responses

Request samples

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

Response samples

Content type
application/json
{
  • "accessToken": "string",
  • "user": {
    }
}

Refresh Access Token

Refresh the accessToken that was given during sign in.

cookie Parameters
jwt
required
string

The refreshToken that was provided when the user signed in

Responses

Logout Account

Log the user out of their account by removing the refresh token and clearing the active user entry in the database.

Responses

Email Tools

Verify Email Address

Handles verification links sent to emails

path Parameters
key
required
string

Key to verify email

Check Email Duplicates

Query the database to see whether or not an email already exists in the system.

path Parameters
email
required
string

The email to query

Responses

Response samples

Content type
application/json
{
  • "exists": true
}

Courses

Courses

Return a list of courses associated with the user account.

header Parameters
Authorization
string
Request Body schema: application/json

Specify whether or not the server should load the directories of the courses. This is a good idea if the courses are easily expandable and might be opened by the user. An example where you might not want to load the directories is when they are only displayed as lists.

loadDirectories
boolean
Default: true

Responses

Request samples

Content type
application/json
{
  • "loadDirectories": true
}

Response samples

Content type
application/json
[
  • {
    }
]

Course

Returns a fully loaded course object with all directories, pages, and cells.

path Parameters
id
required
string

ID of course

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Response samples

Content type
application/json
{
  • "id": "c1aa059a-1e25-4525-977c-9c405c0980de",
  • "courseCode": "CS-1021",
  • "affiliation": "none",
  • "subject": "Computer Science",
  • "license": "none",
  • "date_created": "2038-01-19 03:14:07",
  • "name": "Intro to Computer Science"
}

Get Single Directory

Get a directory

path Parameters
id
required
string

Directory ID

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "courseId": "string",
  • "pages": [
    ]
}

Delete Single Directory

Delete a directory from the database.

path Parameters
id
required
string

Directory ID

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema: application/json

Optionally specify whether or not the delete is permanent.

permanent
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "permanent": false
}

Create New Directory

Create a new Directory

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema:

Body should contain entire directory object without id.

id
string
name
string
courseId
string
Array of objects or null (Page)

Responses

Request samples

Content type
{
  • "id": "string",
  • "name": "string",
  • "courseId": "string",
  • "pages": [
    ]
}

Update Directory

Update a directory

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema: application/json

Include directory object with existing directory id.

id
string
name
string
courseId
string
Array of objects or null (Page)

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "courseId": "string",
  • "pages": [
    ]
}

Course

Create a new course element and save to the database.

path Parameters
id
required
string

ID of course

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Response samples

Content type
application/json
[
  • {
    }
]

put-course-id

path Parameters
id
required
string

ID of course

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Course

Delete a course.

Must only be done by the account that created the course.

path Parameters
id
required
string

ID of course

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema: application/json

Specify whether the delete is permanent.

permanent
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "permanent": false
}

Enrollment

Get the role of the given user for the private course.

path Parameters
id
required
string

Private Course ID

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Response samples

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

Enrollment

Enroll current account in course.

path Parameters
id
required
string

Private Course ID

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Directory

Get Single Directory

Get a directory

path Parameters
id
required
string

Directory ID

header Parameters
Authorization
string

Must contain Bearer with accessToken

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "courseId": "string",
  • "pages": [
    ]
}

Delete Single Directory

Delete a directory from the database.

path Parameters
id
required
string

Directory ID

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema: application/json

Optionally specify whether or not the delete is permanent.

permanent
boolean
Default: false

Responses

Request samples

Content type
application/json
{
  • "permanent": false
}

Create New Directory

Create a new Directory

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema:

Body should contain entire directory object without id.

id
string
name
string
courseId
string
Array of objects or null (Page)

Responses

Request samples

Content type
{
  • "id": "string",
  • "name": "string",
  • "courseId": "string",
  • "pages": [
    ]
}

Update Directory

Update a directory

header Parameters
Authorization
string

Must contain Bearer with accessToken

Request Body schema: application/json

Include directory object with existing directory id.

id
string
name
string
courseId
string
Array of objects or null (Page)

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "courseId": "string",
  • "pages": [
    ]
}