Skip to content

Use of ABS Api #18

Description

@Vito0912

DISCLAIMER: I used the latest available stable APK release.

Hello,

I am a contributor of ABS (but not maintainer!) and check third party clients for their API usage as in history there were many bugs with stats, playback, permissions etc. which caused loss of e.g. stats, and caused requests and issues on the ABS Discord and GitHub. I try to make this for every new (or app I add to my collection of apps) app I see and try to give them some recommendations of the API, as the API docs are not maintained at the moment, so often it's not even knowable what is right. Most of the apps I send this issue are new, so don't take this as bad critisim, but a hint.
I also started a "database" to collect all clients, list their features and rate their API usage. As I like ABS myself, built a client, SDK and OpenAPI spec myself, I want to give a detailed feedback on what an app can do better in terms of Usage with ABS. All of this ofc. is just a recommendation

This report only represents a short testing period on a production server that has some usage, so bugs may have occurred that did not exist on smaller or newer server setups.

Note

This does not mean you have to implement that this way, this is just note that it was intended that way so either these endpoints become deprecated in the future or problems can occur with using these methods. You can ofc also leave it the way it is currently.
This should be NOT a bad criticism. As said I try to give feedback in that matter to any app.

Important

This is the first watch app I am testing. Although I have an Android watch, I only tested it in the emulator. Unfortunately, I do not have a setup to monitor the payloads the apps send, and I do not want to dig into the code, so I can only give estimates about why things fail.

Old authentication method

You are still using the old authentication method. The old authentication method you are using now (or at least the token you use) will be removed soon.

Playing a file

With the newer ABS versions there is a more secure way of playing files that don't need the token to be transmitted to request the files. You can check the web client or offical apps to see how it's done. The old api endpoint likely will not be removed any time soon, but the new one is more secure due to not needing to transmit the token. This needs the use of sessions. See the Progress section

Progress

I never got it to sync progress while playing. If I switched to another book or changed chapters from the view I saw, the app made a request, but it did not when just listening, which could cause a lot of progress loss if the app closed incorrectly.
Even when doing a progress sync, the books progress never updated or had any progress attached, so the book never showed any updated progress.

Even if, the /progress endpoint is the wrong one for updating progress. /progress should only be used for a one-time, static update (such as marking a book as finished from the UI). It does not send progress updates to clients when used through that endpoint, leading to wrong behavior with the official apps and any app using websockets.

You also never use sessions (I know it's a watch app and much harder). Without sessions, the user will have no stats generated by your app. All stats (daily listening, Year in Review, etc.) are calculated from sessions. By not using sessions, this data does not get recorded.
Please use the /play endpoint when connected to the internet and ONLY use local sessions after being online and reconnecting, but only after checking that the last edited date of the session is correct so you do not overwrite progress. The last edited date should be the actual last edit, not the last time online.

Requests

You make many requests to /api/items/?expanded=1&include=progress, which results in a 404. I also cannot mark a book as finished, failing with the same problem, probably because you are fetching it too early.

Downloads

They did not work at all for me. It instantly seems to fail without a message (icon resets). But I see that a request is being made to the server. But please use the /download permission. Without that even users without download permission could download (altough it generally did not work for me)

Usage of items

You request the whole library without pagination. This could leads to high RAM usage for the watch app I would imagine, but also stress the server and slow down requests. Not to say that it creates high data useage for the end user.

I hope this helps you building a great and awesome ABS client!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions