PHP code example of arkon-event / codereadr-api-client

1. Go to this page and download the library: Download arkon-event/codereadr-api-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arkon-event / codereadr-api-client example snippets



use ArkonEvent\CodeReadr\ApiClient\Client;
$client = new Client('youAPIKey');

//Example get all users and print usernames
try{
   $responseXML = $client->request(Client::SECTION_USERS, Client::ACTION_RETREIVE);
   //Response is a \SimpleXMLElement object
   foreach ($responseXML->user as $user){
   echo 'username: '.$user->username.PHP_EOL;
   }
} catch(\Throwable $e){
   echo 'API error: '.$e->getMessage();
}