Book
APIs for book
Get All Book Meta Data
GET
http://localhost:7002/api/book
* To issue a new access token, refer to
Auth.Sign In
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>
bid
* To issue a new access token, refer to
Auth.Sign In
* To get the information of available
bid
s, refer to Book.Get All Book Meta Data
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
bid
* To issue a new access token, refer to
Auth.Sign In
* To get the information of available
bid
s, refer to Book.Get All Book Meta Data
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
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
bid
s, 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
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>
bid
and certain page
*
page
starts from 1 (1 ≤ page
≤ page_num
)* To issue a new access token, refer to
Auth.Sign In
* To get the information of available
bid
s, 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
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
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
bid
s, refer to Book.Get All Book Meta Data
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
* To issue a new access token, refer to
Auth.Sign In
* To get the information of available
bid
s, refer to Book.Get All Book Meta Data
*
anc
should be a stringified JSON array. Recommend to use JSON.stringify()
method.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: |
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
* 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
bid
s, refer to Book.Get All Book Meta Data
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
* 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
bid
s, refer to Book.Get All Book Meta Data
* To get the information of available
rank
, refer to Book.Get Book Meta Data
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
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
bid
s, refer to Book.Get All Book Meta Data
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
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
bid
s, 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
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
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
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
bid
s, refer to Book.Get All Book Meta Data
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
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
bid
s, refer to Book.Get All Book Meta Data
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.