Created
October 22, 2017 02:23
-
-
Save stayregular/b6e8d95b0241074cc3de7259aa9f7f49 to your computer and use it in GitHub Desktop.
Test connection to Kushy API with Directus SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'vendor/autoload.php'; | |
$client = \Directus\SDK\ClientFactory::create('', [ | |
// Directus API Path without its version | |
'base_url' => 'https://api.kushy.net/', | |
'version' => '1.1' // Optional - default 1 | |
]); | |
$params = [ | |
'offset' => 50 | |
]; | |
$strains = $client->getItems('strains', $params); | |
foreach($strains as $strain) { | |
echo $strain->name . '<br>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment