OlegKlimenko / Plamber-Android

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

Interact with generating author list API at uploading books page. #42

Closed OlegKlimenko closed 6 years ago

OlegKlimenko commented 6 years ago

When a user is uploading book he must enter an author of the book. To do as minimum duplicates as possible in a database, there is an API which will generate authors list and a user must ability to select from the existing authors. So this URL must be used when a user enters to 'author' input field (this call checks if the substring is present in any author name in the database, and return the list of authors): <host>/api/v1/generate-authors/

Request as follows:

{"user_token": "<user_token>",
 "author_part": "l"}

Error response (user token not exists):

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

A successful response will be like this output:

{
    "detail": "successful",
    "data": [
        "gl",
        "sdlfk",
        "LOP",
        "lutz"
    ],
    "status": "200"
}

If no authors was generated, the data param will be an empty list (array)

OlegKlimenko commented 6 years ago

Interact with generating author list API at uploading books page.