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
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
?>
- PHP, Web Server HTTPS
- Alma Ex Libris
- Nazzareno Bedini - University of Pisa
- [1] Alma webhooks.