### Instantiate Webling API Client Source: https://github.com/usystems/webling-api-php/blob/master/README.md Demonstrates how to create a new instance of the Webling API client with default and custom options. Includes basic API request methods like GET, PUT, POST, and DELETE. ```php $api = new Webling\API\Client('https://demo.webling.ch','MY_APIKEY'); $response = $api->get('member/123'); if ($response->getStatusCode() < 400) { var_dump($response->getData()); // returns the parsed JSON var_dump($response->getRawData()); // returns the raw response string } $response = $api->put('/member', $data); $response = $api->post('/member', $data); $response = $api->delete('/member/123'); ``` ```php $options = [ 'connecttimeout' => 5, // connection timeout in seconds 'timeout' => 10, // transfer timeout 'useragent' => 'My Custom User-Agent' // custom user agent ]; $api = new Webling\API\Client('https://demo.webling.ch','MY_APIKEY', $options); ``` -------------------------------- ### Cache Webling API Data with File Adapter Source: https://github.com/usystems/webling-api-php/blob/master/README.md Illustrates how to use the caching mechanism to store and retrieve Webling API data locally using a file adapter. Supports caching single objects, binary data, multiple objects, and object lists. ```php $client = new Webling\API\Client('https://demo.webling.ch','MY_APIKEY'); $adapter = new Webling\CacheAdapters\FileCacheAdapter([ 'directory' => './webling_cache' ]); $cache = new Webling\Cache\Cache($client, $adapter); // get single object $member = $cache->getObject('member', 506); // get binary data of object $cache->getObjectBinary('member', 506, $member['properties']['Mitgliederbild']['href']); // get multiple objects $cache->getObjects('member', [506, 507, 508]); // get object lists $cache->getRoot('membergroup'); // check for updates and renew cache $cache->updateCache(); // clear the whole cache $cache->clearCache(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.