### Basic Usage Example Source: https://github.com/lyytioy/lyyti-api-wrapper-php/blob/master/README.md A simple example showing how to initialize the client, fetch events, and iterate through them to display their names. ```php // Init LyytiApi object $lyyti_api = new LyytiApi\Client("private_key", "public_key"); // Get events from API $events = $lyyti_api->getEvents()->data; // Use the events foreach ($events as $event) { $first_event_language = $event->language[0]; $event_name = $event->name->$first_event_language; echo $event_name."\n"; } ``` -------------------------------- ### Client Initialization with Cache Source: https://github.com/lyytioy/lyyti-api-wrapper-php/blob/master/README.md Example of initializing the Lyyti API client with a custom cache configuration (5-minute lifetime, file-based persistence). ```php $lyyti_api = new LyytiApi\Client("private_key", "public_key", new LyytiApi\Cache(1, "cachefile.json")); ``` -------------------------------- ### Basic API Request and Response Handling Source: https://github.com/lyytioy/lyyti-api-wrapper-php/blob/master/README.md Demonstrates how to initialize the client, make a request to get events, and access the response data, HTTP status code, and potential errors. ```php $lyyti_api = new LyytiApi\Client("private_key", "public_key"); $response = $lyyti_api->getEvents(); // Events list if the request was successful (Dynamic type. In this case type = ?array) $data = $response->data; // Http code for the response (type = int) $http_code = $response->http_code; // Error text if the request failed (type = ?string) $error = $response->error; ``` -------------------------------- ### Namespace Import Source: https://github.com/lyytioy/lyyti-api-wrapper-php/blob/master/README.md This is the namespace that needs to be imported to use the Lyyti API client. ```php use Lyyti\API\v2\Client as LyytiApi; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.