OlegKlimenko / Plamber-Android

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

Implement setting current readed page API interaction #34

Closed OlegKlimenko closed 6 years ago

OlegKlimenko commented 6 years ago

When user is changing book page there must be send request with changing page. URL: <host>/api/v1/set-current-page/

Request:

{"user_token": "751c234b-ca87-4eb8-9e27-f667e7d346f3", 
"book_id": 22, 
"current_page": 155}

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"}

Error response (current page sent not as a number):

{
    "status": 400,
    "detail": "current page not a number",
    "data": {}
}

Successful response:

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

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

OlegKlimenko commented 6 years ago

Implement setting current readed page API interaction