I am making a site that allows users to search and send to print a Shutterstock photo Like this one: https://wallprint.ee/
I am following the Shutterstock API documentation and trying to use this to connect, search and pick photos: https://github.com/shutterstock/php-shutterstock-api
Is this the best and easiest way to do it?
This is the way I am trying now:
<?php
require_once __DIR__ . '/vendor/autoload.php';
$clientId = '***';
$clientSecret = '****';
$client = new Shutterstock\Api\Client($clientId, $clientSecret);
var_dump($client);
// perform an image search for puppies
$client->get('images/search', array('query' => 'puppies'));
$imageResponse = $client->get('images', array('id' => array(1, 2, 3)));
if ($imageResponse->getStatusCode() != 200) {
// error handler
}
$images = $imageResponse->getBody()->jsonSerialize()['data'];
// etc
I expected:
Some kind of response with the content.
I got
Client error:
GET https://api.shutterstock.com/v2/images?id=1&id=2&id=3
resulted in a403 Forbidden
response: {"message": "You do not have access to this route. Please contact api@shutterstock.com for more information"}
I read that since I use 'get', I am told that a free APP can't do using get: https://developers.shutterstock.com/documentation/authentication#accounts-and-limitations. I wrote about that already to api@shutterstock.com.
But what options do I have to develop it in a simplest and painfree manner?