OlegKlimenko / Plamber-Android

The Android application for Plamber project.
https://plamber.com.ua/
Apache License 2.0
1 stars 0 forks source link

Implement loading last page API interaction #33

Closed OlegKlimenko closed 6 years ago

OlegKlimenko commented 6 years ago

When user clicks on the book from home (which he is reading) system must ping this api to retrieve last readed page: <host>/api/v1/read-book/

Request:

{"user_token": "751c234b-ca87-4eb8-9e27-f667e7d346f3",
 "book_id": <book_id>}

Error response (user with token not exists; book with id not exists; added book with pair user/book_id don't exists):

{"status": 404,
 "details": "not exists"}

Successful response:

{
    "data": {
        "last_page": 500
    },
    "detail": "successful",
    "status": 200
}

Where the last page is the last readed page. By default this value is 1 which created when you started reading book.

All other responses are connection lost/unhandled errors. Also will be discussed and tested

OlegKlimenko commented 6 years ago

Implement loading last page API interaction