Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lending endpoints should be formed based on availability. #244

Open
judec opened this issue Oct 17, 2022 · 0 comments
Open

Lending endpoints should be formed based on availability. #244

judec opened this issue Oct 17, 2022 · 0 comments

Comments

@judec
Copy link

judec commented Oct 17, 2022

'action': 'borrow_book',

The archive.org lending endpoint to create a new loan accepts one of two values for the "action" parameter: borrow_book or browse_book. borrow_book attempts to initiate a 14-day loan. browse_book attempts to initiate a 1-day loan. As it stands, there is no automatic fallback, so if you request a borrow, but only browse is available, you will get an error instead of a loan.

You can tell whether a book can be borrowed or browsed by the corresponding lending status fields "available_to_borrow" or "available_to_browse." These are stored in the search engine (but not in meta.xml) as lending___available_to_borrow and lending___available_to_browse. They may be reflected in the bulk availability API -- not sure. They are definitely reflected in the singular /services/loans/loan/?action=availability API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant