Make BSS Great Again (bshs.or.kr) (1.0.0)

Download OpenAPI specification:Download

This is the tentative API specification for Busan Science High School Alumni Website, Make BSS Great Again. Note that this project does not have any official relationship between Busan Science High School. Therefore, if you have any questions/suggestions/complaints, please contact our team with the email or contact information listed above.

Get Started

All API calls require secured connection (only HTTPS). To use the APIs, the users need to retrieve access token by signin with username and password (basic authentication). As of now, we do not support multi-factor authentication, but before we service the application/website MFA will be supported.

Details of the Security Schemes are described below.

Notes

  • Auth API Completed
  • User API
    • POST /user Completed
    • GET /user/{username} completed
    • PUT /user/{username} completed

SecuritySchemes

accessToken

Access token will be used to authenticate/authorize user to use the API.

Security Scheme Type API Key
Cookie parameter name: X-ACCESS-TOKEN

refreshToken

Refresh token will be used to renew expired access token. If the refresh token also expired, the user need to login again by using basic authentication.

Security Scheme Type API Key
Cookie parameter name: X-REFRESH-TOKEN

Auth

Authorization/Authentication operations

Login

Login with username and password to retrieve access/refresh tokens

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

Responses

Request samples

Content type
application/json
{
  • "username": "gildong123",
  • "password": "gildongpw1"
}

Logout current session

Logout from current session

Authorizations:

Responses

Logout other sessions

Logout from all other sessions, except for current session

May get new refreshToken if current token is about to expire

Authorizations:

Responses

Renew Access/Refresh Tokens

Renew expired access token using refresh token. Renew refresh token if it about to expire.

Authorizations:

Responses

Change User's Password

User to change the password by using the refresh token and current password. Logout from the other sessions once the change password operation success.

When user fail to provide correct current password or the new password does not comply with the password rule, it throws 400 BadRequest Error.

May get new refreshToken if current token is about to expire

Authorizations:
Request Body schema: application/json
currentPassword
required
string
newPassword
required
string

Responses

Request samples

Content type
application/json
{
  • "currentPassword": "thisisprevpassword",
  • "newPassword": "HelloWorld"
}

User

User account related operations

Create new user

Create a new user account.

Need username and password to create the account, admission year, legal name, and email. Also accept nickname, phone number, and affiliation as optional fields

Email will be verified after the creation of the account, while the phone number will not be verified.

username and password that do not comply with rules may lead 400 Bad Request error.

Request Body schema: application/json
username
required
string
password
required
string
admissionYear
required
integer >= 1
legalName
required
string
nickname
string
email
required
string <email>
object
object

Responses

Request samples

Content type
application/json
{
  • "username": "gildong123",
  • "password": "gildongpw1",
  • "admissionYear": 13,
  • "legalName": "홍길동",
  • "nickname": "GildongTheGreat",
  • "email": "gildong.hong@gmail.com",
  • "phoneNumber": {
    },
  • "affiliation": {
    }
}

Response samples

Content type
application/json
{
  • "username": "gildong123"
}

Search users

List up users with matching search criteria. Only signed in user can search the article.

User can specify the search term with query string. Supported options are:

  • admissionYear
  • name
  • username
  • verified

Other options will be ignored but will not throw error. The search result will be ordered by name.

50 results will be returned at most, user can search further by indicating page parameter in the query string.

Authorizations:
query Parameters
admissionYear
integer >= 2002

Integer for admission year

name
string

name of the user

username
string

username uniquely indicating the user

verified
boolean

Flag used to display unverified user. Only verified user is displayed by default (default value of the flag is true).

page
integer

Indicating the page number that used to navigate the search result.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Retrieve user detail

Retrieve user's information.

Returns user's public information if the other user try to retrieve the information. If owner/admin of the account try to retrieve the information, the private/public information associated with the user account will be returned.

This API requires username (provided as path parameter).

Authorizations:
path Parameters
username
required
string

Username indicating user account. Same as user's login ID.

Responses

Response samples

Content type
application/json
Example
{
  • "username": "gildong123",
  • "admissionYear": 13,
  • "legalName": "홍길동",
  • "nickname": "Gildong Hong",
  • "email": [
    ],
  • "phoneNumber": {
    },
  • "affiliation": {
    }
}

Update user detail

Modify user's information. Only the owner of the account and admin account can use this API. Suspended and deleted users cannot be updated.

This API requires username (provided as path parameter). In the RequestBody, the contents to be modified are listed. User is only allowed to modify nickname, phone number, affiliation, and email.

If the user changed the email, the user need to verify the new email. Before the verification, the email will not be used for notification and public contact.

If part of requests failed, the other change requests will be proceed. It will respond with 200, but with "Partially processed" message in the response body.

Authorizations:
path Parameters
username
required
string

Username indicating user account. Same as user's login ID.

Request Body schema: application/json
nickname
string
object
object
Array of objects non-empty unique

Responses

Request samples

Content type
application/json
{
  • "nickname": "New Nickname",
  • "phoneNumber": {
    },
  • "affiliation": {
    },
  • "emailChange": [
    ]
}

Send email verify link

Issue verification ticket and send it to the email in order to verify email of newly created user and changed email of existing user. Used to get new verification ticket as after calling new account creation API and user information update API will trigger verification process automatically and send the verification ticket to the provided email.

Need email address to be verified

Authorizations:
Request Body schema: application/json
email
required
string <email>

Responses

Request samples

Content type
application/json
{
  • "email": "gildong.hong@example.com"
}

Veify user's email

Verify email with the provided veify ticket/link generated by send email verify link API. This API require ticketID (provided as path parameter).

Authorizations:
path Parameters
ticketID
required
string

ticketID that has been generated by send email verify link API.

Responses

Find username

Find username by using email, name, and admission year.

If the user with matching information found, the part of the username (first three and last two characters) will be returned.

Request Body schema: application/json
name
required
string
email
required
string <email>
admissionYear
required
number >= 1

Responses

Request samples

Content type
application/json
{
  • "name": "홍길동",
  • "email": "gildong.hong@example.com",
  • "admissionYear": 2015
}

Response samples

Content type
application/json
{
  • "username": "gil*****23"
}

Send username to email

Find and send username by using email, name, admission year, and search result of find-username API.

If the user with matching information found, the email containing username will send.

Request Body schema: application/json
name
required
string
email
required
string <email>
admissionYear
required
number >= 1
maskedUsername
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "홍길동",
  • "email": "gildong.hong@example.com",
  • "admissionYear": 13,
  • "maskedUsername": "gil*****23"
}

Reset password

Reset password with the reset ticket/link generated by send password reset link API. This API require ticketID (provided as path parameter), username and new password.

path Parameters
ticketID
required
string

ticketID that has been generated by send password reset link API.

Request Body schema: application/json
username
required
string
newPassword
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "gildong123",
  • "newPassword": "thisisnewpassword"
}

report fake/spam user to admin

Users can report other fake/spam user to admin. They need to provide proper reasons why they think the other user is harmful or fake/spam account.

If the number of report counts spikes, the reported user is temporarily lost access to the website during investigation.

Authorizations:
path Parameters
username
required
string

Username indicating user account. Same as user's login ID.

Request Body schema: application/json
reason
required
string
additionalComment
string

Responses

Request samples

Content type
application/json
{
  • "reason": "fake news",
  • "additionalComment": "This information contains fake and dangerous information, which has been confirmed by the authorities."
}

Get list of challenge questions for approval

Get list of challenge questions that let user to instantly approved as an alumni.

Only new users can do the challenge once. If the approved user or new user that already consumed their attempt, it will throw 400 error.

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Submit answer and Get result of challenge

Submit the answers of the challenge questions that generated by GET /user/promote API. The result of the challenge will be returned as the result.

This API should be used after the challenge question retrival API called.

Authorizations:
Request Body schema: application/json
answerList
required
Array of any

Responses

Request samples

Content type
application/json
{
  • "answerList": [
    ]
}

Response samples

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

Suggest the user as a real alumni

Users have authority to help admins to identify real alumni. They can upvote the other user as alumni of BSS.

If the upvotes the new user received exceed threshold, the user is considered as a verified BSS alumni.

Authorizations:
path Parameters
username
required
string

Username indicating user account. Same as user's login ID.

Responses

Retrieve list of alumni who upvoted the user

Retrieve the list of alumni members who upvoted the new user. This API will return the array of usernames and their names.

Authorizations:
path Parameters
username
required
string

Username indicating user account. Same as user's login ID.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Cancel the suggestion for the new user as a real alumni

Users have authority to help admins to identify real alumni. The users can cancel the upvote for the new user. If they want to alert admin spam/fake user, they need to use report features, rather than just deleting the upvote.

If the upvotes the new user received exceed threshold, the user is considered as a verified BSS alumni.

Authorizations:
path Parameters
username
required
string

Username indicating user account. Same as user's login ID.

Responses

Board

Articles/Threads/Posts related operations

Write a new post

Write a new post on board. Only Signed in user can upload the article.

Need title and category of the post, and the contents. Once the post successfully created, return the URL of the article. Note that article URL contains postID, and this is created by mixing generated date, userID, and title.

Authorizations:
Request Body schema: application/json
title
required
string
category
string
content
required
string <HTML>

Responses

Request samples

Content type
application/json
{
  • "title": "Hello World.",
  • "category": "Group 1",
  • "content": "<p>Hello World!!</p>"
}

Response samples

Content type
application/json

Retrieve a list of articles with matching search criteria

List up posts with matching search criteria. Only Signed in user can search the article.

User can specify search terms as query string. Supported options are

  • Title
  • Writer (ID/Name)
  • Content
  • Category

Other options will be ignored but will not throw error. The search result will be ordered by last modified date.

50 results will be returned at most; user can search further by indicating page parameter in the query string.

Authorizations:
query Parameters
title
string

String that contains in the title of article(s).

writer
string

ID or Name of article's writer.

content
string

String that contains in the content of either article or related comments.

category
string

Name of category. Need to be match exactly.

page
integer

Indicating the page number that used to navigate the search result.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Make a new category

Make a new category. Admin can only create category.

Authorizations:
Request Body schema: application/json
categoryName
required
string

Responses

Request samples

Content type
application/json
{
  • "categoryName": "Group1"
}

Retrieve list of existing categories.

Retrieve list of all existing categories.

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Delete an existing category

Delete a category with given categoryName. Only admin user can delete the post.

The articles in the category are not removed, but the category information is removed.

Authorizations:
path Parameters
categoryName
required
string

Name of the category.

Responses

Delete an existing post

Delete a post having given postID. Only writer of the article or admin user can delete the post.

Authorizations:
path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Responses

Modify an existing post.

Modify an existing post having matching postID. Only writer of the article or admin user can modify the post.

Can modify either title, category of the post, or the contents. Once the post successfully created, return the URL of the article.

path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Request Body schema: application/json
title
string
category
string
content
string <HTML>

Responses

Request samples

Content type
application/json
{
  • "title": "Hello World.",
  • "category": "Group 1",
  • "content": "<p>Hello World!!</p>"
}

Response samples

Content type
application/json

Retrieve existing post.

Retrieve a post having given postID. Every verified user can read the article.

Authorizations:
path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Responses

Response samples

Content type
application/json
{
  • "title": "Hello World.",
  • "category": "Group 1",
  • "content": "<p>Hello World!!</p>"
}

Add Like to the article.

Give Like to the post. Every user with read access to the post can add Like.

Authorizations:
path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Responses

Response samples

Content type
application/json
{
  • "likeCount": 8
}

Remove Like to the article.

Remove Like to the post. Every user with read access to the post can remove Like.

Authorizations:
path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Responses

Response samples

Content type
application/json
{
  • "likeCount": 8
}

Retrieve Like counts of the article.

Retrieve Like counts of the post. Every user with read access to the post can retrieve the number of Likes.

Authorizations:
path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Responses

Response samples

Content type
application/json
{
  • "likeCount": 8
}

Report harmful article to admin

Users can report harmful article; they need to provide proper reasons why they think the article is harmful. Admin should review the article.

If the number of report counts spikes, the article is automatically blinded while the admin reviewing the contents.

Authorizations:
path Parameters
postID
required
string

an unique, url-safe ID generated by mixing writer's ID, generated date, and the title of the article.

Request Body schema: application/json
reason
required
string
additionalComment
string

Responses

Request samples

Content type
application/json
{
  • "reason": "fake news",
  • "additionalComment": "This information contains fake and dangerous information, which has been confirmed by the authorities."
}

Comment

Comments related operations

Write a new comment

Write a new comment associated with a post. Only signed in user can create a comment.

Need postID to indicate which article the user want to write a comment on. Each comment has unique comentID, which generated by mixing associated post's ID, writer's ID, generated datetime, and part of contents.

If user want to reply to an existing comment, specify parentComment field with commentID of parent's comment.

Authorizations:
Request Body schema: application/json
postID
required
string <postID>
content
required
string
parentComment
string <commentID>

Responses

Request samples

Content type
application/json
{
  • "postID": "BASE64URLPOSTID1",
  • "content": "Hello World - This is a comment.",
  • "parentComment": "COMMENTIDURLSAFEBASE64STRING"
}

Retrieve comments associated with the post

List the comments associated with the post. Only signed in user can upload the article.

This API require postID as a query string in order to specify which article that user want to retrieve the comments.

By default, first 50 comments will be returned. To navigate next comments, specify page argument in query string.

Other options will be ignored but will not throw any exception. The comment will be ordered by generated date, and the child comments will follow the its parent.

Authorizations:
query Parameters
postID
required
string <postID>

Unique ID indicating an article

page
integer

Indicating the page number that used to navigate the search result.

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Delete an existing comment

Delete the comment having given commentID. Only writer of the comment or admin user can delete the comment.

Authorizations:
path Parameters
commentID
required
string

an unique, url-safe ID generated by mixing associated post's ID, writer's ID, generated datetime, and part of contents.

Responses

Modify an existing comment

Modify an existing comment having matching commentID. Only writer of the comment or admin user can modify the comment.

Authorizations:
path Parameters
commentID
required
string

an unique, url-safe ID generated by mixing associated post's ID, writer's ID, generated datetime, and part of contents.

Request Body schema: application/json
postID
required
string <postID>
content
required
string
parentComment
string <commentID>

Responses

Request samples

Content type
application/json
{
  • "postID": "BASE64URLPOSTID1",
  • "content": "Hello World - This is a comment.",
  • "parentComment": "COMMENTIDURLSAFEBASE64STRING"
}

Report harmful comment to admin.

Users can report harmful comment; they need to provide proper reasons why they think the comment is harmful. Admin should review the comment.

If the number of report counts spikes, the comment is automatically blind while the admin reviewing the contents.

Authorizations:
path Parameters
commentID
required
string

an unique, url-safe ID generated by mixing associated post's ID, writer's ID, generated datetime, and part of contents.

Request Body schema: application/json
reason
required
string
additionalComment
string

Responses

Request samples

Content type
application/json
{
  • "reason": "fake news",
  • "additionalComment": "This information contains fake and dangerous information, which has been confirmed by the authorities."
}

Notification

Notification related operations

Create new notification

Create new notification that will be displayed when user logged in.

New comments and replies on the article/comment that the user wrote are subject to the notification. The notifications will be grouped by postID or commentID based on the context of the notifications. The timestamp and replier's/commenter's id will be saved as an array for each commentID or postID.

Note that this API is only accessible from other API servers. Individual users, including admin, cannot call this API directly.

Authorizations:
Request Body schema: application/json
timestamp
required
string <datetime>
actionType
required
string
Enum: "comment" "reply"
targetObjectID
required
string <postID/commentID>
toUsers
required
Array of strings <username>

Responses

Request samples

Content type
application/json
{
  • "timestamp": "2017-07-21T17:32:28.000Z",
  • "actionType": "comment",
  • "targetObjectID": "BASE64URLPOSTID",
  • "toUser": [
    ]
}

Retrieve list of notifications

Retrieve list of notifications that has been created by create new notification API calls. Result is ordered by most recently created date-time.

All read notifications will be removed after 7 days from read.

Authorizations:

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Read notification

Indicate existing notification as read.

Authorizations:
path Parameters
objectID
required
string

either postID or commentID that indicating the object that related to the notification.

Responses

Send email

Send HTML formatted email to the user.

Note that this API is only accessible from other API servers. Individual users, including admin, cannot call this API directly.

Authorizations:
Request Body schema: application/json
to
required
Array of any
title
required
string
content
required
string <html>

Responses

Request samples

Content type
application/json
{
  • "to": [
    ],
  • "title": "Hello MBGA",
  • "content": "<p>Hello World!!</p>"
}

send user weekly activity digest

Send weekly digest to every users. Once this API called, it will generate weekly digest emails by combining templates with user's unread notifications, featured article, and other event information. Then, it will call sendEmail API to send the digest emails.

Note that this API is only accesible from other API servers. Individual users, including admin, cannot call this API directly.

Authorizations:

Responses