Connectors / Service / Shutterstock

Shutterstock

Shutterstock

Shutterstock is a provider of stock photography, footage, music, and editing tools.

Overview

Shutterstock is a service connector that provides a high-quality assets, tools and services for video, music and images. Shutterstock offers a variety of plans for individuals, teams, and enterprise customers as well as creative editing and collaboration capabilities.

Authentication

When using the Shutterstock connector, the first thing you will need to do is go to your Tray.io account page, and select the workflow you wish to work on. Once in the workflow builder itself, search and drag the Shutterstock connector from the connectors panel (on the left hand side) onto your workflow.

With the new Shutterstock connector step highlighted, in the properties panel on the right, click on the Authenticate tab and 'Add new authentication' (located under the 'Authentication' field).

This will result in a Tray.io authentication pop-up window. The first page will ask you to name your authentication, and state which type of authentication you wish to create ('Personal' or 'Organisational').

As you can see, the next page asks you to select the permissions scopes you would like to grant.

After being redirected to Shutterstock, click on the Allow button found at the bottom of the window.

In order to get a Shutterstock account, you need to sign up on Shutterstock.

Once you have been authenticated, go back to your settings authentication field (within the workflow builder properties panel), and select the recently added authentication from the dropdown options now available.

Your connector authentication setup should now be complete.

Available Operations

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Using the Raw HTTP Request ('Universal Operation')

As of version 1.0, you can effectively create your own operations.

This is a very powerful feature which you can put to use when there is an endpoint in shutterstock which is not used by any of our operations.

To use this you will first of all need to research the endpoint in the Shutterstock API documentation v2, to find the exact format that Shutterstock will be expecting the endpoint to be passed in.

Note that you will only need to add the suffix to the endpoint, as the base URL will be automatically set (the base URL is picked up from the value you entered when you created your authentication).

The base URL for shutterstock is: https://api.shutterstock.com/v2

For example, say that the 'List video collections' operation did not exist in our Shutterstock connector, and you wanted to use this endpoint, you would use the Shutterstock API docs to find the relevant endpoint - which in this case is a GET request called: /videos/collections.

More details can be found here.

As you can see there is also the option to include a query parameter, should you wish to do so. So if you know what your method, endpoint and details of your query parameters are, you can get the information with the following settings:

Method: GET

Endpoint: /videos/collections

Query Parameter: Key: per_page Value: 100

Body Type : none : { "none" : null }

Final Example outcome being: https://api.shutterstock.com/v2/videos/collections?per_page=100

Example Usage

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Shutterstock connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

Below is an example of a way in which you could potentially use the Shutterstock connector, to retrieve the details of a every video collection you have created.

The steps will be as follows:

  1. Setup using a manual trigger and list video collections
  2. Loop through collections
  3. Retrieve the details to each video collection

The final outcome should look like this:

1 - Setup Trigger & List Video Collections

Once you have clicked 'Create new workflow' from your main Tray.io dashboard named it, select the Manual trigger from the trigger options available:

After you have been redirected to the Tray.io workflow dashboard, from the connectors panel on the left, add a Shutterstock connector to your second step. Set the operation to 'List video collections'.

Feel free to re-name your steps as you go along to make things clearer for yourself and other users.

Upon completion, you will have set up the manual trigger and retrieved the video collections.

2 - Loop Collection

Next, search for the Loop collection connector within your connector panel, and drag it into your workflow as your next step. Set your operations to 'Loop list'.

The Loop Collection connector allows you to iterate through a list of results. In this example, we will use it to iterate through the data found within the previous 'List video collections' connector step.

In order to specify the list you want to loop through, start by using the 'List' mapping icon (found next to the list input field, within the properties panel) to generate the connector-snake.

While hovering over the 'List video collections' step (with the tail end of the connector-snake), select data from the list of output properties displayed. This will auto-populate a jsonpath within your 'List' input field, and update the type selector to jsonpath.

For more clarification on the pathways you have available, open the Debug panel to view your step's Input and Output.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray.io, please see our Intro page and Data Guide for more details.
CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

Now, you will be able to loop through the video collections you retrieved in the first step.

3 - Get Video Collection

The last step is to drag a Shutterstock connector inside of the Loop Collection step itself. Set the operation to 'Get video collection'. As you can see, the 'ID' field is required.

Once again, use the connector snake and hover over the 'Loop Collection' step (with the tail end of the connector-snake), select 'id' value from the list of output properties displayed.

INTERPOLATION: When you wish to include JSON generated data within another input/ output/ result, use our Interpolation method as described here.

Click on 'Debug' at the top of the page and you can see your workflow execution. You will see the connector looping through the list of video collections as provided by step 1.

If you click on each execution of 'Get Video Collection', you will be able to see the results of each loop.

BEST PRACTICES: Whenever you do decide to create your own workflow, please make sure you take a look at our Managing data best practices guide.

All Operations

Latest version:

1.0