This group is used by operations but is not declared in the specification’s tag list, so it has no description of its own.

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.5" \
  -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.5`, {
  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.5",
    },
    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

  • eventIdstringrequired

    A unique identifier for the event.

  • typeunknownrequired
  • Show 5 fieldsHide 5 fields
    • acknowledgementobject

      If this is set, the checkout needs to be acknowledged to be completed.

    • checkoutCheckoutFieldrequired

      See CheckoutField in the schema index

    • See CheckOutOrInMessage in the schema index

    • requestIdstringrequired

      This is an unique identifier for the checkout request. This will change for each request.

    • statusstringrequired

      This tells the status of the checkout.

      The status are:

      • completed means that the checkout went well and was completed.
      • failed means that the checkout failed, and the item was not checked out.

      One of: completed · failed

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.