PHP code example of cydh / idrowikiapi

1. Go to this page and download the library: Download cydh/idrowikiapi 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/ */

    

cydh / idrowikiapi example snippets




use Cydh\IdrowikiAPI;

$db = new IdrowikiAPI\IdrowikiAPI(IdrowikiAPI\ApiType::ITEM_DROPLIST, 608); // Yggdrasil Berry
$db->setEndpoint("https://db.idrowiki.org/renewal/api/");
$db->setAuthKey("IDROWIKIAPIKEY");
$db->execute();
if ($db->isSuccess()) {
    var_dump($db->simplePrint());
    var_dump($db->getLink());
} else {
    print "Error with code '".$db->getErrorCode()."'. Message: ".$db->getErrorMessage().PHP_EOL;
}

use Cydh\IdrowikiAPI\ApiType;