Last active
October 6, 2018 02:53
-
-
Save molcik/741f9c2afb7dd97aaaa130d334dc29f6 to your computer and use it in GitHub Desktop.
Getty Images API SDK - PHP
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 __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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment