Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 936 Bytes

README_ComposerInstall.md

File metadata and controls

39 lines (24 loc) · 936 Bytes

Using the SDK via PHP composer

Assumptions

  1. PHP is setup and configured correctly
  2. Composer is setup on your machine (Either globally or locally). This readme won't go into the specifics. But Composer has a good writeup

Empty Project

Create composer.json with these contents

{
  "require": {
       "gettyimages/gettyimages-api": "dev-master"
  }
}

Run the following command

composer install

Create your .php file

<?php
  require 'vendor/autoload.php';
  use GettyImages\Api\GettyImages_Client;

  $apiKey = "myApiKey";
  $apiSecret = "myApiSecret";

  $client = GettyImages_Client::getClientWithClientCredentials("$apiKey", "$apiSecret");

  $response = $client->SearchImages()->withPhrase("cat")->execute();

  var_dump($response);

Already established Project

composer require gettyimages/gettyimages-api