Skip to content

Instantly share code, notes, and snippets.

@stayregular
Created October 22, 2017 02:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stayregular/b6e8d95b0241074cc3de7259aa9f7f49 to your computer and use it in GitHub Desktop.
Save stayregular/b6e8d95b0241074cc3de7259aa9f7f49 to your computer and use it in GitHub Desktop.
Test connection to Kushy API with Directus SDK
<?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