/events/receiver Receives events from an LMS
Example request
cURL
curl -X POST "$PLAS_BASE_URL/events/receiver?version=0.6.3" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $PLAS_TOKEN" \
-d '{
"eventId": "84410",
"type": "consent_changed",
"data": {
"consent": {
"available": [
{
"type": "loan_history",
"version": "2025-01"
}
],
"evaluated": [
{
"type": "loan_history",
"given": true,
"version": "2025-01"
}
]
},
"patronId": "40218873"
}
}' JavaScript
const response = await fetch(`${process.env.PLAS_BASE_URL}/events/receiver?version=0.6.3`, {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
},
body: JSON.stringify({
"eventId": "84410",
"type": "consent_changed",
"data": {
"consent": {
"available": [
{
"type": "loan_history",
"version": "2025-01"
}
],
"evaluated": [
{
"type": "loan_history",
"given": true,
"version": "2025-01"
}
]
},
"patronId": "40218873"
}
}),
}); Python
import os
import requests
response = requests.post(
f"{os.environ['PLAS_BASE_URL']}/events/receiver",
params={
"version": "0.6.3",
},
headers={
"Accept": "application/json",
"Content-Type": "application/json",
"Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
},
json={
"eventId": "84410",
"type": "consent_changed",
"data": {
"consent": {
"available": [
{
"type": "loan_history",
"version": "2025-01",
},
],
"evaluated": [
{
"type": "loan_history",
"given": True,
"version": "2025-01",
},
],
},
"patronId": "40218873",
},
},
)
response.raise_for_status() PLAS_BASE_URL the provider’s base URL · PLAS_TOKEN an access token.
Parameters
Shared across operations: version. See the shared contract on the version page.Request body
application/json · required · EventReceiverRequest Selected by the field type
Variant: consent_changed
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- patronIdstringrequired
Variant: patron_deleted
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 1 fieldHide 1 field
- patronIdstringrequired
Variant: reservation_ready_for_pickup
EventReservationReadyForPickup
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- patronIdstring
- reservationPatronReservation
Variant: ready_reservation_expires_soon
EventReadyReservationExpiresSoon
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- patronIdstring
- reservationPatronReservation
Variant: reservation_expires_soon
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- patronIdstring
- reservationPatronReservation
Variant: reservation_reminder
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- patronIdstring
- reservationPatronReservation
Variant: loan_due_date_is_approaching
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- loanPatronLoan
- patronIdstring
Variant: fee_due_date_is_approaching
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
- dataobjectrequired
Show 2 fieldsHide 2 fields
- feePatronFee
- patronIdstring
Variant: item_checkout
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
Show 5 fieldsHide 5 fields
- statusstringrequired
This tells the status of the checkout.
The status are:
completedmeans that the checkout went well and was completed.failedmeans that the checkout failed, and the item was not checked out.
One of: completed · failed
- acknowledgementobject
If this is set, the checkout needs to be acknowledged to be completed.
- messageCheckOutOrInMessage
- requestIdstringrequired
This is an unique identifier for the checkout request. This will change for each request.
Variant: item_checkin
- eventIdstringrequired
A unique identifier for the event.
- typeunknownrequired
Show 5 fieldsHide 5 fields
- statusstringrequired
This tells the status of the checkin.
The status are:
completedmeans that the checkin went well and was completed.failedmeans that the checkin failed, and the item was not checked in.
One of: completed · failed
- completedboolean
This tells if the checkin was completed or not. It is only true if the checkin was completed, else it is false.
- messageCheckOutOrInMessage
- requestIdstringrequired
This is a unique identifier for the checkout request. This will change for each request.
Responses
204 OK
No response body.
400 The list of errors. Errors
Shared response, defined once for the whole API. See the shared contract on the version page.
Example
{
"errors": [
{
"code": 500,
"info": "500: System error"
}
]
} Schema
The first error should always be the most relevant.
Show 2 fieldsHide 2 fields
- codeintegerrequired
A number representing the type of error.
List of error codes:
- \<error code\>: \<error description\>
- 500: System error
- 600: Unsupported Open Library API version</br>
One of: 500 · 600
- infostringrequired
Starts with the text matching the error code field (defined above), and a describing text could be added.
401 Secret is invalid.
Shared response, defined once for the whole API. See the shared contract on the version page.
No response body.