Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 1.05 KB

README.md

File metadata and controls

30 lines (26 loc) · 1.05 KB

Alma-Webhook-Class-PHP

A class to use Alma Ex Libris webhooks in php scripts

  • You can use both JSON and XML output
  • Challenge and Signature verification
  • Logging system

Usage

Example code

<?php
require("Alma_webhook_class.php");
$webh = new almaWebhook('Secret'); // or $webh = new almaWebhook() if you place secret in class file directly;
if ($webh->result) {
    //your code (use $webh->res_obj to collect data; if you prefer arrays, use $dataray = (array)$webh->res_obj, $webh->result contains result as a string);
    $action = $webh->res_obj->action; // event type in Alma    
    $webh->addLog("this is happening"); // add info to log
  } 
file_put_contents("filelog.txt", $webh->log, FILE_APPEND); // save log to a file
?>

Prerequisites

  • PHP, Web Server HTTPS
  • Alma Ex Libris

Authors

  • Nazzareno Bedini - University of Pisa

References