c API
use strict;
use warnings;
use Moo 1;
use REST::Client;
use MIME::Base64;
use JSON qw(encode_json decode_json);
use WebService::Shutterstock::Lightbox;
use WebService::Shutterstock::Client;
use
w( error => "missing 'password' param for auth call");
}
$self->client->POST(
'/auth/customer.json',
{
username => $args{username},
password => $args{password}
}
);
my $auth_info = $se
me}: $auth_info"
);
}
}
sub categories {
my $self = shift;
$self->client->GET('/categories.json');
return $self->client->process_response;
}
sub search {
my $self = shift;
my %args = @_;
subscription for a specific Shutterstock customer
use strict;
use warnings;
use Moo;
use JSON qw(encode_json);
use WebService::Shutterstock::LicensedImage;
use Carp qw(croak);
with 'WebService::Shu
use warnings;
use Moo;
use WebService::Shutterstock::Subscription;
use Carp qw(croak);
use JSON qw(encode_json);
with 'WebService::Shutterstock::AuthedClient';
sub account_id {
my $self = shift;
ld__info {
my $self = shift;
my $client = $self->client;
$client->GET( sprintf( '/customers/%s.json', $self->username ), $self->with_auth_params );
my $data = $client->process_response;
return $d
ild_subscriptions {
my $self = shift;
$self->client->GET( sprintf( '/customers/%s/subscriptions.json', $self->username ), $self->with_auth_params );
my $subscriptions = $self->client->process_respo
my $self = shift;
my $client = $self->client;
$client->GET( sprintf('/lightboxes/%s/extended.json', $self->id), $self->with_auth_params );
return $client->process_response;
}
);
has id => (
my $self = shift;
my $client = $self->client;
$client->GET( sprintf( '/lightboxes/%s/public_url.json', $self->id ), $self->with_auth_params );
if(my $data = $client->process_response){
return $da
e_id = shift;
my $client = $self->client;
$client->DELETE(
sprintf( '/lightboxes/%s/images/%s.json', $self->id, $image_id ),
$self->with_auth_params( username => $self->username )
);
delete $s
s easy REST interactions with the Shutterstock API
use strict;
use warnings;
use Moo;
use JSON qw(decode_json);
use WebService::Shutterstock::Exception;
extends 'REST::Client';
sub response {
my
} elsif($code <= 299){ # a success
return $content_type =~ m{^application/json} && $self->responseContent ? decode_json($self->responseContent) : $response->decoded_content;
} elsif($code <= 399)
,
sub {
my $self = shift;
my $client = $self->client;
$client->GET( sprintf( '/images/%s.json', $self->id ) );
my $data = $client->process_response(404 => sub {
return { is_available =>
milar {
my $self = shift;
my $client = $self->client;
$client->GET(sprintf('/images/%s/similar.json', $self->id));
my $images = $client->process_response;
return [ map { $self->new_with_client( '
a proxy class for the data returned from a URL
like L<http://api.shutterstock.com/images/15484942.json>. Please look
at that data structure for a better idea of exactly what each of the attributes
in
ild__results_data {
my $self = shift;
my $client = $self->client;
$client->GET('/images/search.json', $self->query);
return $client->process_response;
}
sub page { return shift->_results_
,
sub {
my $self = shift;
my $client = $self->client;
$client->GET( sprintf( '/videos/%s.json', $self->id ) );
my $data = $client->process_response(404 => sub {
return { is_available =>
as a proxy class for the data returned from a URL
like L<http://api.shutterstock.com/videos/12345.json>. Please look
at that data structure for a better idea of exactly what each of the attributes
in