Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require __DIR__.'/vendor/autoload.php'; // <--- Notice this line, it's missing in example file
- // include __DIR__.'/build/GettyImagesApi.phar'; // <--- Uncaught DI\Definition\Exception\DefinitionException: Entry "ICurler" cannot be resolved
- include __DIR__.'/src/GettyImages_Client.php';
- use GettyImages\Api\GettyImages_Client;
- $apiKey = "superSecretApiKey";
- $apiSecret = "superSecretApiSecret";
- //Example of built in search images endpoint
- $types = array("easyaccess", "editorialsubscription");
- $client = GettyImages_Client::getClientWithClientCredentials("$apiKey", "$apiSecret");
- $response = $client->SearchImages()->withPhrase("cat")->withProductTypes($types)->execute();
- var_dump($response);
Add Comment
Please, Sign In to add comment