DELETE patrons/{id} – REST API

Delete a Patron: DELETE /patrons/{id}

Remove a single patron by passing the patron’s barcode or email as an id.

Deleting a patron will immediately remove their entire lending/hold history from the system. This action is unrecoverable!

Query Parameters

  • id: A unique ID for the patron – parameter accepts either the barcode or email.

JSON Result Details

A successful deletion will not return any body data.

<?php
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.libib.com/patrons/2020000000013",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_CONNECTTIMEOUT => 5,
  CURLOPT_TIMEOUT => 15,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "x-api-key: YOUR_API_KEY",
    "x-api-user: YOUR_API_USER"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $obj = json_decode($response);
}

Was this article helpful?

Related Articles