Skip to content

Lending endpoints should be formed based on availability. #244

@judec

Description

@judec

'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.

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