Book

APIs for book

Get All Book Meta Data

GET

http://localhost:7002/api/book

Return all book's meta data.
* To issue a new access token, refer to Auth.Sign In
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Success

200 : Success


                                
                            

Fail

401 : Unauthorized

x-access-token is not valid or expired.

Get Book Meta Data

GET

http://localhost:7002/api/book/<bid>

Return the meta data of the book with certain bid
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Success

200 : Success


                                
                            

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing

Get Book Cover

GET

http://localhost:7002/api/book/<bid>/cover

Return the cover page of the book with certain bid
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Success

200 : Success

image(.png)

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing

Register Book Read

POST

http://localhost:7002/api/book/<bid>/read

Register the book with bid to the list of read books of the user who currently signed in
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
* To access the list of read books of the user, refer to User.Get All User Read Book
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Success

200 : Success

the book has been successfully registered

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing

Get Book Page

GET

http://localhost:7002/api/book/<bid>/<page>

Return a page of the book with certain bid and certain page
* page starts from 1 (1 ≤ pagepage_num)
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
* To get the maximum value(page_num) for page, refer to Book.Get ALl Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

page

required

int

Page Number

Success

200 : Success

image(.png)

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameters
- bid is not in a correct type, or not existing
- page is not in a correct type, or not existing

Get Book Text

GET

http://localhost:7002/api/book/<bid>/text

Return the full text of the book with certain bid
* Currently, this api is only available for certain bids: 8, 10, 21, 22, 31, 38, 40, 41, 55
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Success

200 : Success


                                
                            

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing

Get Book Keyword

GET

http://localhost:7002/api/book/<bid>/keyword

Return keywords of the book
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
* anc should be a stringified JSON array. Recommend to use JSON.stringify() method.
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Query Parameters

Field Type Description

num

optional

int

number of keywords that want to receive (default: 10)

anc

optional

array

ancestors of keywords (default: [] (empty array))

Success

200 : Success


                                
                            

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing

Get Book Main Sentence

GET

http://localhost:7002/api/book/<bid>/main-sentence

Return main sentences of the book
* Main sentences are pre-calculated for books with bid 8, 10, 21, 22, 31, 38, 40, 41, 55. Request for bid except 8, 10, 21, 22, 31, 38, 40, 41, 55 will be slow.
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Query Parameters

Field Type Description

num

optional

int

number of main sentences that want to receive (default: 10)

Success

200 : Success


                                
                            

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing

Get Book Main Image

GET

http://localhost:7002/api/book/<bid>/main-image

Return main image(.png) of the book
* Currently, this api is only available for certain bids: 8, 10, 21, 22, 31, 38, 40, 41, 55
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
* To get the information of available rank, refer to Book.Get Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Query Parameters

Field Type Description

rank

required

int

Rank of the image. Starts from 1.

thumbnail

optional

boolean

If true, thumbnail will be sent. If false, original image will be sent. If not set, original image will be sent(same with false).

Success

200 : Success

image(.png)

Fail

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing
- rank is not provided, not in a correct type, or not existing

Verify QnA Question

POST

http://localhost:7002/api/book/<bid>/qna/verify/question

Verify if question is valid under certain bid
* Currently, this api is only available for certain bids: 8, 10, 21, 22, 31, 38, 40, 41, 55
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Body Parameters

Field Type Description

question

required

string

Question

Success

200 : Success

question is valid (Good to use)

Fail

400 : Bad Request

question is not valid (Not good to use)

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameters
- bid is not in a correct type, or not existing.
- question is not provided, or empty(length is 0)

Verify QnA Answer

POST

http://localhost:7002/api/book/<bid>/qna/verify/answer

Verify if answer is valid under certain bid and question
* Currently, this api is only available for certain bids: 8, 10, 21, 22, 31, 38, 40, 41, 55
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
* The API assumes question is valid. Recommend to verify question before run the api. Refer to Book.Verify QnA Question
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Body Parameters

Field Type Description

question

required

string

Question

type

required

int

Question Type. 0: Multiple Choices, 1: Short Answer

answer

required

string

Answer
- If type is 0(Multiple Choices), answer should be in this format: answer_option_num#@@#option1#@@#option2#@@#option3#@@#option4 ex) "4#@@#바다토끼#@@#죽은 토끼#@@#염기성 토끼#@@#모두 다"
- If type is 1(Short Answer), answer should be in this format: answer ex) "염기성 토끼"

Success

200 : Success

answer is valid (Good to use)

Fail

400 : Bad Request

answer is not valid (Not good to use)

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameters
- bid is not in a correct type, or not existing.
- question is not provided, or empty(length is 0)
- type is not not provided, not in a correct type, or not one of available values (0, 1)
- answer is not provided, empty(length is 0), not in a right format for type

Submit Question

POST

http://localhost:7002/api/book/<bid>/qna/submit

Submit a new question and answer pair.
* Currently, this api is only available for certain bids: 8, 10, 21, 22, 31, 38, 40, 41, 55
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Body Parameters

Field Type Description

question

required

string

Question

type

required

int

Question Type. 0: Multiple Choices, 1: Short Answer

answer

required

string

Answer

Success

200 : Success

question and answer submission success.

Fail

400 : Bad Request

question is not valid, or answer is not valid.

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameters
- bid is not in a correct type, or not existing.
- question is not provided, or empty(length is 0)
- type is not not provided, not in a correct type, or not one of available values (0, 1)
- answer is not provided, empty(length is 0), not in a right format for type

Get Random Question Answer

GET

http://localhost:7002/api/book/<bid>/qna/rand

Get a random question and answer pair.
* Currently, this api is only available for certain bids: 8, 10, 21, 22, 31, 38, 40, 41, 55
* To issue a new access token, refer to Auth.Sign In
* To get the information of available bids, refer to Book.Get All Book Meta Data
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

bid

required

int

BID

Success

200 : Success


                                
                            

Fail

400 : Bad Request

No submitted questions not bid

401 : Unauthorized

x-access-token is not valid or expired.

404 : Not Found

Invalid Parameter
- bid is not in a correct type, or not existing.