This repository was archived by the owner on Nov 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.php
More file actions
46 lines (31 loc) · 1.32 KB
/
example.php
File metadata and controls
46 lines (31 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* This file contains examples of all the shutterstock api.
*/
//include Shutterstock API PHP Client lib
require_once('ShutterstockApiClient.php') ;
$sapi = new ShutterstockApiClient();
#Get category list
$categories = $sapi->getCategories();
#Search for images by keywords and various filters
$search_result = $sapi->search('dog');
#Get information about customer
$customer_info = $sapi->getCustomerUserInfo();
#Get list of all customer lightboxes
$lightboxes = $sapi->getLightboxes();
#Add new lightbox
$add_lightbox = $sapi->addLightbox('ssapi_test'.rand(0, 9999));
#Add image to particular lightbox
$add_lightbox_image = $sapi->addImageToLightbox($add_lightbox['lightbox_id'], 113021647);
#Remove image from particular lightbox
$remove_lightbox_image = $sapi->deleteImageFromLightbox($add_lightbox['lightbox_id'], 113021647);
#Get all images from particular lightbox
$lightbox_details = $sapi->getLightbox($add_lightbox['lightbox_id']);
#Delete particular lightbox
$delete_lightbox = $sapi->deleteLightbox($add_lightbox['lightbox_id']);
#Get list of all subscriptions for loggedin customer
$subscription = $sapi->getSubscriptions();
#Get download history for loggedin customer
$downloads = $sapi->getDownloads();
#Download an image using a subscription
$download = $sapi->downloadImage(113021647, 12345678, 'small', 'jpg');