User

APIs for user

Get User Information

GET

http://localhost:7002/api/user

Return all information of the user who currently signed in
* To issue a new access token, refer to Auth.Sign In
* read_book_bids automatically removes repeating books. That is, even if the user continually reopens a book, it will only appeared once.
* read_book_bids is sorted in order of date. Recent read book appears first.
* wids is sorted in order of updated_date. Recently updated work appears first.
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 All User Read Book

GET

http://localhost:7002/api/user/book

Return all books' bid the user who currently signed in read in time order.
* To issue a new access token, refer to Auth.Sign In
* read_book_bids automatically removes repeating books. That is, even if the user continually reopens a book, it will only appeared once.
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Query Parameters

Field Type Description

num

optional

int

Number of the bid that want to receive. Should be an integer bigger than 0. Invalid value will be ignored(fall to default). In default, it will return all books that the user read.
The api will conduct the job with its best effort. If the number of the book the user read is smaller than num, it will return only bids that the user read. If you have to deal with the total number of the result(ex. traverse), recoommand to re-count the result, not just use num you provide.

Success

200 : Success


                                
                            

Fail

401 : Unauthorized

x-access-token is not valid or expired.

Get All User Work

GET

http://localhost:7002/api/user/work

Return all work wids conducted by the user who currently signed in
* To issue a new access token, refer to Auth.Sign In
* To save a new work, refer to User.Save User Work (Create New)
* wids are sorted in order of updated_at. Recently updated work appears first.
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 User Work

GET

http://localhost:7002/api/user/work/<wid>

Load the work of certain wid conducted by the user who currently signed in
* To issue a new access token, refer to Auth.Sign In
* To save a new work, refer to User.Save User Work (Create New)
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Path Parameters

Field Type Description

wid

required

int

WID

Success

200 : Success


                                
                            

Fail

400 : Bad Request

Invalid parameters
- wid is not provided, not in the correct type, not exists, or not created by the user who signed in

401 : Unauthorized

x-access-token is not valid or expired.

Save User Work (Create New)

POST

http://localhost:7002/api/user/work/save

Save the work of the user who currently signed in
* To issue a new access token, refer to Auth.Sign In
* To save the updated work, refer to User.Save User Work (Update)
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Body Parameters

Field Type Description

bid

required

int

BID

type

required

int

Type of the work. 0: 생각펼치기, 1: 독서퀴즈, 2: 그림 그리기, 3: 그림 설명하기

content

required

array

Stringified JSON data that represents the user's work

Success

200 : Success

The work has been successfully saved

Fail

400 : Bad Request

Invalid parameters
- bid is not provided, not in the correct type, or not exists
- type is not provided, not in the correct type, or not one of available values (0, 1, 2, 3)
- content is not provided, or empty(length is 0)

401 : Unauthorized

x-access-token is not valid or expired.

Save User Work (Update)

POST

http://localhost:7002/api/user/work/save

Save the work of the user who currently signed in
* To issue a new access token, refer to Auth.Sign In
* To save a new work, refer to User.Save User Work (Create New)
Request
Response

Headers

Field Type Description

x-access-token

required

string

Access Token

Body Parameters

Field Type Description

wid

required

int

WID

content

required

array

Stringified JSON data that represents the user's work

Success

200 : Success

The work has been successfully saved

Fail

400 : Bad Request

Invalid parameters
- wid is not provided, not in the correct type, or not exists
- content is not provided, or empty(length is 0)

401 : Unauthorized

x-access-token is not valid or expired.