Where the provider sends events about patrons and items as they happen. A consent changed, a patron deleted, a reservation ready or about to expire, a loan or a fee due soon, an item checked out or checked in. The vendor registers this address through Configuration.

1 operation
POST /events/receiver

Receives events from an LMS

Bearer token ReceiverEvents

Example request

cURL

curl -X POST "$PLAS_BASE_URL/events/receiver?version=0.6.7" \
  -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": [
        {
          "given": true,
          "type": "loan_history",
          "version": "2025-01"
        }
      ]
    },
    "patronId": "40218873"
  }
}'

JavaScript

const response = await fetch(`${process.env.PLAS_BASE_URL}/events/receiver?version=0.6.7`, {
  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": [
          {
            "given": true,
            "type": "loan_history",
            "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.7",
    },
    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": [
                    {
                        "given": True,
                        "type": "loan_history",
                        "version": "2025-01",
                    },
                ],
            },
            "patronId": "40218873",
        },
    },
)
response.raise_for_status()
The host and token are environment variables: 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

EventConsentChanged

Variant: patron_deleted

EventPatronDeleted

  • eventIdstringrequired

    A unique identifier for the event.

  • typeunknownrequired
  • dataobjectrequired
    Show 1 fieldHide 1 field
    • patronIdstringrequired

Variant: reservation_ready_for_pickup

EventReservationReadyForPickup

Variant: ready_reservation_expires_soon

EventReadyReservationExpiresSoon

Variant: reservation_expires_soon

EventReservationExpiresSoon

Variant: reservation_reminder

EventReservationReminder

Variant: loan_due_date_is_approaching

EventLoanDueDateIsApproaching

Variant: fee_due_date_is_approaching

EventFeeDueDateIsApproaching

Variant: item_checkout

EventItemCheckout

Variant: item_checkin

EventItemCheckin

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.

Generated from the schema

Example

{
  "errors": [
    {
      "code": 500,
      "info": "500: System error"
    }
  ]
}

Schema

Errors

  • errorsarray of Errorrequiredmin items 1

    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.