The Enneo SDK offers a comprehensive collection of tools that facilitate the development of specific code for
customer-specific solutions in the field of AI-supported customer support. The SDK supports the
implementation of rule-based logic for AI agents, event-based integrations, custom webhooks
and user-defined functions. The SDK is automatically loaded and the functions are directly available.
Invocation of any Enneo API endpoints (GET | POST | PATCH | PUT | DELETE)
<?phpuseEnneoSDK\ApiEnneo;require(getenv()['SDK']??'sdk.php');/*** Loads the contract data for the contract with the ID123*/$contract=ApiEnneo::getContract(contractId:123);/*** Loads ticket data for the ticket with the ID456*/$ticket=ApiEnneo::getTicket(ticketId:456);/*** Executes the user-defined function'user-defined-function'.*(see documentation of user-defined functions)* Entered parameters are passed to the user-defined function*and can be loaded there using \EnneoSDK\Input::load().*/$response=ApiEnneo::executeUdf( name:'user-defined-function', parameters:['method'=>'POST','api'=>'redirect','params'=>$payload]);############################################################################ The methods get | post | patch | put | delete can be used,## to call any Enneo API endpoints## (see API documentation)##########################################################################/*** Load the profile of the currently logged in user*/$profile=ApiEnneo::get(endpoint:'/api/mind/profile');/***OCR meter reading recognition for given ticket IDandURL to ticket attachment*/$response=ApiEnneo::post( endpoint:'/api/cortex/ocrMeter', body:['ticketId'=>$ticketId,'fileUrl'=>$_ENV['ENNEO_API_URL'].$attachment->url,]);/*** Close ticket*/$response=ApiEnneo::patch( endpoint:'/api/mind/ticket/'.$ticketId, body:['status'=>'closed']);
Custom functions in the code are called using executeUdf:
<?php// Load Enneo SDKrequire(getenv()['SDK']);// Prepare payload for the API call of the third-party system$payload=['ticket-id'=>123,'key'=>'value'];// Call the custom function "third-party-api-call"// this function takes an object as an input parameter:// [// 'method' => 'POST',// 'api' => 'item',// 'params' => [// 'ticket-id' => 123,// 'key' => 'value'// ]// ]EnneoSDK\ApiEnneo::executeUdf('third-party-api-call',['method'=>'POST','api'=>'item','params'=>$payload]);