Three ways in
Which API you work with depends on which end you're building. The specification is the same with every library system that implements it.
Provider API · Vendor API
You build a service
An app, a website, self-service, an info screen or a staff tool. You call the Provider API, and implement the Vendor API if the service uses single sign-on or events.
Follow the four stepsProvider API
You supply the system
The library system implements the Provider API: the operations, the token endpoint and how callers are told apart.
Implement the APISearch API · Content API
You supply data
Search or events. The Search API and the Content API are subsets of the Provider API's operations, each with its own specification. The spec itself notes that search, for example, can be handed to a third party.
See the four APIs
First call in four steps
The steps apply to the Provider API in the version that is in production. The details for each step are in the sections below.
Get access
The base URL and your client credentials come from the provider — the vendor of the library system, which implements the token endpoint. The spec has no shared base URL.
Check the version
The call needs no token and returns the version the provider recommends — a first check of the connection before you authenticate.
Get a token
Send your client credentials and get a
Bearertoken back. It goes in theAuthorizationheader on the calls that follow.Make the first call
The configuration tells you what the library system has switched on — checkout, checkin and which identity providers can be used, for example. Before checkout and checkin, the spec requires the service to find them switched on here.
Not sure which calls your service needs? Features start from what you want to build and list the calls behind each one. The spec says of itself that it is still a work in progress and that fields and structure may change — every version is listed with its OpenAPI file on the API overview, and the changelog says what changed in each.
Base URL
The spec has no servers block. The base URL belongs to the provider, not to PLAS, and is agreed with the provider. Every path in the reference — /, /, / — is relative to it.
The spec describes two ways a provider can tell its callers apart: a base URL per library with credentials per vendor, so the same service calls different addresses at different libraries, or one base URL for all, with credentials identifying both library and vendor. Don’t assume the base URL is the same from one library to the next, even with the same provider.
Authentication
The Provider API uses OAuth 2.0 with client credentials. One call returns a token, and the token goes on the calls that follow.
Get a token. Send a POST to / with Content-Type: application/x-www-form-urlencoded and three fields: client_, client_ and grant_ with the value client_. The call itself needs no token.
POST /authentication/oauth2/token
Content-Type: application/x-www-form-urlencoded
client_id=<client_id>&client_secret=<client_secret>&grant_type=client_credentials
The response is JSON with three fields — all required:
access_— the token itself. The spec recommends that the provider issues a JWT, so it can be used if part of the API (search, say) is handed to a third party.token token_— alwaystype Bearer.expires_— the token’s lifetime in seconds.in
Use the token. Put it in the Authorization header: Authorization: Bearer <access_token>. Only three operations do without: Get, Authenticate and Revoke.
When it expires. HTTP 401 means the token is missing, invalid or expired. A token you no longer need is withdrawn with Revoke
Rules that apply to every call
These rules are stated once in the spec. The shared contract — the parameters and error responses nearly every operation shares — is on the version overview.
version(query, optional, on nearly every operation) — the API version the client expects. If the provider doesn’t support it, it responds with error code600.ui_(query, optional, on the operations that declare it) — the language the provider returns text in. Codes follow the MARC language list.language - URL and query parameters are expected to be URL-encoded. An id containing a comma in a comma-separated list is therefore encoded as
%2, while the comma between the ids stays as it is.C - Dates and times follow RFC 3339. A point in time is a
date-with a capitaltime Tand an explicit time zone — the spec assumes none. A plain date isYYYY-.MM- DD - Responses should contain no HTML unless the operation explicitly says so.
- Responses that map the ids you sent contain only those the provider knows. Unknown ids are left out; if all are unknown, the response is an empty map.
Errors
An error response (HTTP 400) is an object with the list errors (Errors); each item has code and info (Error), and the first is the most relevant. The code is a number, and the full list is in the Error
500— system error at the provider.600— the version you asked for isn’t supported.10001— the operation is disabled at this provider.
The rest are domain-specific — 100023 for an unknown patron, 102001 for an unknown loan — and are all listed in Error; several operations describe the ones they can return.
The HTTP codes 400, 401, 404 and 429 are shared responses, described on the version overview. 401 comes in two kinds: a token that is missing, invalid or expired, and a failed client sign-in on Authenticate. A wrong patron sign-in has its own error code, 100001. 429 means the provider is limiting the number of calls — it is declared on Checkin, Checkout and Change; the response should say in Retry- how many seconds to wait, and the patron must be shown “try again later”, not an error in what they sent.
When the library system calls the service
Traffic also runs the other way. It goes through the Vendor API, and the service implements that part itself.
Single sign-on
The patron signs in with an identity provider, and the library system sends the patron's browser back to the service's callback with
codeandstate— orerrorif it failed. The service completes the sign-in withcodeand itscode_(PKCE). Registration returns to the same callback; deletion has its own.verifier - GET
/patron/authentication/identity-providerThis will fetch a SSO URL used for patron login, matching the chosen identity provider. - GET
/callbacks/patronYour service Callback endpoint for Patron SSO login and registration. - POST
/patron/authentication/identity-providerAuthenticate patron by code and code verifier from SSO login.
- GET
Events
The service registers an address and a secret, and the library system sends events there — a reservation that is ready, a loan due soon or a consent that has changed, for example. What is sent depends in part on the patron's notification settings.
Implementing the Provider API
Then you are the provider. Beyond the operations, the spec describes five things you need to decide on — the last two are recommendations from its security section.
The token endpoint is yours
The spec says you should implement
POST /authentication/oauth2/tokenand issue tokens against client credentials. The spec recommends a JWT, because it can be used if part of the API — search, say — is handed to a third party.You decide how callers are told apart
The spec names two ways: a base URL per library with credentials per vendor, or one base URL where the credentials identify both.
Features can be switched on and off
Gettells the service what is switched on; before checkout and checkin the service has to check it. Error codeConfiguration 10001means an operation is disabled.A UUID as patronId
The spec strongly recommends a UUID — and, if the system uses integer patron ids, adding a UUID alongside and using only that in PLAS.
Limit sign-in attempts
Rate limiting per patron identifier on
POST /patron/authenticationandPOST /patron/authentication/no-password, and per patron when credentials are reset or changed. When credentials are changed, the limit should respond with429.