Olapic Widget API - Version 2.2

The Olapic REST API provides programmatic access to read and write Olapic data. With the Olapic API, you can grab UGC information and product data, upload new media to the Olapic account, and more. The REST API responses are available in JSON.

Versioning

API calls must have the query string parameter version with a value of v2.2 in order to use this version of the API.

Example request:

https://photorankapi-a.akamaihd.net/?version=v2.2

Postman Collection

You can easily try out the Olapic API using Postman with this ready-made Postman collection.

It comes bundled with a sample environment to help you get up and running fast.

Run in Postman

Authentication

API calls must be authenticated using an api_key that must be provided as a query string using the auth_token field.

You can find your api_key in the Settings page of your Olapic account.

Example request:

https://photorankapi-a.akamaihd.net?auth_token={api_key}&version=v2.2

Root Endpoint

Accessing the root endpoint, https://photorankapi-a.akamaihd.net/ (without any endpoint path), allows you to grab the information of the authenticated customer.

When you access the root endpoint using a specific API key, it will return the customer entity related to the API key being used in the request.

This is synonymous to the Get Customer by ID endpoint.

Pagination

For any endpoint returning a collection of objects in the response, you can send the parameter count as query string, to indicate the maximum number of elements per page to be returned by the API.

The value sent can be any integer number between 1 and 50. The default value is 20.

In order to navigate through the generated pages, you need to follow the URLs in the _links attribute of the API responses. These URLs must not be saved since they have an expiration time.

Expiration time for the pagination links is 43200 seconds (or 12 hours).

Example request:

https://photorankapi-a.akamaihd.net/some/collection?count={count}&auth_token={api_key}&version=v2.2

Error Code

The Olapic API returns HTTP status codes in addition to JSON-based error codes and messages.

Errors example

The Olapic API error messages are returned in JSON format. For example, an error might look like this:

{
  "metadata": {
    "code": 400,
    "message": "Bad Request",
    "version": "v2.0"
  },
  "data": {
    "message": "The parameter \"id\" is missing."
  }
}

The following table contains some of the common error messages that can be returned from the API.

Message Description
"The parameter [PARAMETER_NAME] is missing." Corresponds with an HTTP 400. The request is missing a required parameter.
"An error was thrown while uploading the file: 'Invalid media file type.'" Corresponds with an HTTP 400. The uploaded file's type is not supported.
"The parameter [PARAMETER_NAME] received an invalid type [SENT_TYPE], expected was [TYPE]." Corresponds with an HTTP 400. One of the parameter's type sent is invalid.
"The parameter [PARAMETER_NAME] received an invalid value [SENT_VALUE], expected was [EXPECTED_VALUE]"." Corresponds with an HTTP 400. One of the parameter's value is invalid.
"There were an issue trying to identify the charset of the parameter [PARAMETER]." Corresponds with an HTTP 400. One of the parameters contains an unsupported character.
"Invalid Credentials." Corresponds with an HTTP 401. Missing or incorrect authentication credentials.
"The authenticated customer is not allowed to access the selected resource." Corresponds with an HTTP 403. The request's customer authentication can't access the requested resource.
"No entity of type [TYPE] was found with id [ID]." Corresponds with an HTTP 404. The specified resource was not found.
"The requested entity [TYPE] with the id [ID]" is inactive." Corresponds with an HTTP 404. The specified resource is inactive and unable to be retrieved.
"No pagination found." Corresponds with an HTTP 404. The requested pagination doesn't exist.

Avoiding 404 HTTP Response

For any endpoint, you can send the parameter wrap_responses={0|1} as query string, to indicate that the API should not return the 404 status code, and wrap the error into a 200 code instead.

In any case, the real status code is always returned in the metadata section of the response.

The default value for the wrap_responses parameter is 0, which means that the API will return 404 HTTP response when requested resources cannot be found.

Example request:

https://photorankapi-a.akamaihd.net/some/collection?wrap_responses={wrap_responses}&auth_token={api_key}&version=v2.2

Caching

Olapic API is served over Akamai CDN, which means that all endpoints leverage CDN caching. It may take up to an hour for changes to reflect in the request responses depending on when the request was cached.

You can check the remaining time (in seconds) by checking the Cache-Control header of the response header. See below for an example:

Note that the CDN caching applies to all requests with 200 HTTP response codes. This means that if you use the wrap_responses query string (refer to the Avoiding 404 HTTP Response section), caching will be applied to the error state of the request as well.

API Usage Examples

Uploading a Media

There are two methods of uploading content to Olapic. The first method involves one single request with the file included as a payload in the form-data. The second method involves the stash endpoint, which allows you to upload content first, then submit the rest of the data (caption, streams, etc) later.

As a pre-requisite, you will have to obtain a user object ID to upload the content. If you do not have a user object, you can create one using the Create a User endpoint.

Method 1: Using the /users/[user_id]/media endpoint

First method uses the Upload Media endpoint, which is very simple. Here’s an example cURL command to upload content using user ID 12345:

curl -X POST -F "file=@/Users/olapic/Pictures/picture.jpg" https://photorankapi-a.akamaihd.net/users/12345/media\?version\=v2.2\&auth_token\=XXXXXXXXXXXX\&wrap_responses\=1\&caption\=This%20is%a%20caption

Valid User ID and the API Key will have to be supplied. The request response will contain the media object that represents the content uploaded.

For parameter definitions, please refer to the endpoint specifications.

Method 2: Using the /stash/ + /users/[user_id]/media endpoints

The second method utilizes the stash endpoint. Using /stash/ endpoint allows you to upload the payload first, without the need to supply the media’s metadata upfront and remove the overhead from the actual submission. This method is useful for bulk upload or eager load scenarios.

  1. Make the POST request /stashes/ with payload attached to file key in the form-data fields

  2. Grab the URI returned from the POST /stashes/, which looks like:

{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//z2photorankapi-a.akamaihd.net/stashes/fAcxTCXC?auth_token=XXXXXXXXXXXX&version=v2.2"
      }
    },
    "id": "fAcxTCXC",
    "_fixed": true
  }
}
  1. Make the POST request to the Upload Media endpoint (/users/[user_id]/media/). The main difference between the first method and this one would be using the stash id provided in the first request response (/stash/) in the url parameter of the Upload Media endpoint.

Here’s an example of the request URL:

curl -X POST https://photorankapi-a.akamaihd.net/users/12345/media\?version\=v2.2\&auth_token\=XXXXXXXXXXXX\&wrap_responses\=1\&caption\=This%20is%a%20caption&url=%2Fstashes%2FfAcxTCXC

The request response will contain the media object that represents the content uploaded.

Retrieving Content using Product ID

One of the primary use cases of content activation is displaying relevant user generated content from your Olapic account on your site’s product pages.

As a pre-requisite, you must have your Product Feed integrated with the Olapic Content Engine in order to retrieve content by product ID.

To retrieve the published content (media) tagged to a particular product (stream), you will use the following two endpoints:

  1. Search Stream by Key

  2. Get Media of a Stream

Take a look at our Carousel Widget Tutorial for a real-world example of how the API endpoints can be utilized in a front-end application.

Here’s a detailed step-by-step guide of retrieving content using the two endpoints describe above.

  1. First, look up the Stream object associated to your Product ID by using Search Stream By Key endpoint.

    curl -X GET https://photorankapi-a.akamaihd.net/customers/{‌{customer_id}}/streams/search?version=v2.2&auth_token={‌{api_key}‌}&tag_key={‌{tag_key}‌}

    Note: The customer_id can be found using the Root endpoint

    Example request:

    curl -X GET https://photorankapi-a.akamaihd.net/customers/215815/streams/search?version=v2.2&auth_token=<omitted>&tag_key=acme-anvil-50lb

    Example response:

    {
        "metadata": {
            "code": 200,
            "message": "OK",
            "version": "v2.0"
        },
        "data": {
            ...
            "id": "2190252887",
            "_fixed": true,
            "shop_button_url": null,
            "share_url": null,
            "_embedded": {
                ...
                "media:recent": {
                    "_links": {
                        "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/2190252887/media/recent?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                        }
                    }
                },
                "media:shuffled": {
                    ...
                },
                "media:photorank": {
                    ...
                },
                "media:rated": {
                    ...
                },
                "media:media_position": {
                    ...
                }
            },
            "name": "Acme Anvil - 50lb",
            "description": "",
            "tag_based_key": "acme-anvil-50lb",
            "product_url": "https://acme.com/acme-anvil-50lb",
            "hide_from_related": false,
            "product_info": {
                "price": null,
                "availability": null,
                "stock": null,
                "color": null
            },
            ...
        }
    }
  2. Once you retrieve the Stream object associated with the Product ID, grab the Stream ID from the id object property within the request response.

    You can retrieve all of the published media from this stream using this Stream ID, using the Get Media of a Stream method.

    curl -X GET https://photorankapi-a.akamaihd.net/streams/{‌{stream_id}}/media/{‌{sorting_option}‌}?version=v2.2&auth_token={‌{api_key}‌}&rights_given={‌{rights_given}‌}&include_tagged_galleries={‌{include_tagged_galleries}‌}

    Note: Some of the query params above are optional to filter request response. For example, include_tagged_galleries can filter out any manually created streams or parent product streams the response.

    See here for various sorting options you can apply: Media Sorting Options

    Example request:

    curl -X GET photorankapi-a.akamaihd.net/streams/2190136730/media/recent?auth_token=<omitted>&version=v2.2
    

    Example response:

    {
        "metadata": {
            "code": 200,
            "message": "OK",
            "version": "v2.0"
        },
        "data": {
            "_links": {
                "first": {
                    "href": "//photorankapi-a.akamaihd.net/streams/2190252887/media/recent?page_key=cf31ba68ebf3e4dadbf207e1932bdcdc&page_number=1&auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                },
                "self": {
                    "href": "//photorankapi-a.akamaihd.net/streams/2190252887/media/recent?page_key=cf31ba68ebf3e4dadbf207e1932bdcdc&page_number=1&auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                },
                "prev": {
                    "href": null
                },
                "next": {
                    "href": null
                }
            },
            "_embedded": {
                "media": [
                    {
                        "_links": {
                            "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/3042079992?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                            }
                        },
                        "id": "3042079992",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "harddrive",
                        "source_id": null,
                        "original_source": null,
                        "caption": "Old school Acme Anvil poster",
                        "video_url": null,
                        "share_url": "https://acme.com/acme-anvil-50lb#opi3042079992",
                        "date_submitted": "2018-10-02T19:31:07+00:00",
                        "date_published": "2018-10-02T19:31:58+00:00",
                        "favorite": false,
                        "location": null,
                        "sonar_place": null,
                        "original_image_width": "513",
                        "original_image_height": "432",
                        "status": "approved",
                        "likes": 0,
                        "request_id": null,
                        "images": {
                            "square": "https://z2photorankmedia-a.akamaihd.net/media/8/w/d/8wd7rd4/square.jpg",
                            "thumbnail": "https://photorankmedia-a.akamaihd.net/media/8/w/d/8wd7rd4/thumbnail.jpg",
                            "mobile": "https://z1photorankmedia-a.akamaihd.net/media/8/w/d/8wd7rd4/mobile.jpg",
                            "normal": "https://photorankmedia-a.akamaihd.net/media/8/w/d/8wd7rd4/normal.jpg",
                            "original": "https://z1photorankmedia-a.akamaihd.net/media/8/w/d/8wd7rd4/original.gif"
                        },
                        ...
                    },
                    {
                        "_links": {
                            "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/3042079997?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                            }
                        },
                        "id": "3042079997",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "harddrive",
                        "source_id": null,
                        "original_source": null,
                        "caption": "Normal product shot",
                        "video_url": null,
                        "share_url": "https://acme.com/acme-anvil-50lb#opi3042079997",
                        "date_submitted": "2018-10-02T19:31:08+00:00",
                        "date_published": "2018-10-02T19:31:58+00:00",
                        "favorite": false,
                        "location": null,
                        "sonar_place": null,
                        "original_image_width": "500",
                        "original_image_height": "500",
                        "status": "approved",
                        "likes": 0,
                        "request_id": null,
                        "images": {
                            "square": "https://z1photorankmedia-a.akamaihd.net/media/d/w/d/dwd7rd4/square.jpg",
                            "thumbnail": "https://z2photorankmedia-a.akamaihd.net/media/d/w/d/dwd7rd4/thumbnail.jpg",
                            "mobile": "https://z1photorankmedia-a.akamaihd.net/media/d/w/d/dwd7rd4/mobile.jpg",
                            "normal": "https://z2photorankmedia-a.akamaihd.net/media/d/w/d/dwd7rd4/normal.jpg",
                            "original": "https://z1photorankmedia-a.akamaihd.net/media/d/w/d/dwd7rd4/original.jpg"
                        },
                        ...
                    },
                    {
                        "_links": {
                            "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/3042079985?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                            }
                        },
                        "id": "3042079985",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "harddrive",
                        "source_id": null,
                        "original_source": null,
                        "caption": "Cool display box",
                        "video_url": null,
                        "share_url": "https://acme.com/acme-anvil-50lb#opi3042079985",
                        "date_submitted": "2018-10-02T19:31:06+00:00",
                        "date_published": "2018-10-02T19:31:57+00:00",
                        "favorite": false,
                        "location": null,
                        "sonar_place": null,
                        "original_image_width": "1377",
                        "original_image_height": "1500",
                        "status": "approved",
                        "likes": 0,
                        "request_id": null,
                        "images": {
                            "square": "https://z3photorankmedia-a.akamaihd.net/media/z/v/d/zvd7rd4/square.jpg",
                            "thumbnail": "https://z2photorankmedia-a.akamaihd.net/media/z/v/d/zvd7rd4/thumbnail.jpg",
                            "mobile": "https://z3photorankmedia-a.akamaihd.net/media/z/v/d/zvd7rd4/mobile.jpg",
                            "normal": "https://z2photorankmedia-a.akamaihd.net/media/z/v/d/zvd7rd4/normal.jpg",
                            "original": "https://z3photorankmedia-a.akamaihd.net/media/z/v/d/zvd7rd4/original.jpg"
                        },
                        ...
                    },
                    {
                        "_links": {
                            "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/3042079982?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                            }
                        },
                        "id": "3042079982",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "harddrive",
                        "source_id": null,
                        "original_source": null,
                        "caption": "Crates of Acme Anvils!",
                        "video_url": null,
                        "share_url": "https://acme.com/acme-anvil-50lb#opi3042079982",
                        "date_submitted": "2018-10-02T19:31:04+00:00",
                        "date_published": "2018-10-02T19:31:55+00:00",
                        "favorite": false,
                        "location": null,
                        "sonar_place": null,
                        "original_image_width": "500",
                        "original_image_height": "404",
                        "status": "approved",
                        "likes": 0,
                        "request_id": null,
                        "images": {
                            "square": "https://z2photorankmedia-a.akamaihd.net/media/w/v/d/wvd7rd4/square.jpg",
                            "thumbnail": "https://photorankmedia-a.akamaihd.net/media/w/v/d/wvd7rd4/thumbnail.jpg",
                            "mobile": "https://z1photorankmedia-a.akamaihd.net/media/w/v/d/wvd7rd4/mobile.jpg",
                            "normal": "https://z2photorankmedia-a.akamaihd.net/media/w/v/d/wvd7rd4/normal.jpg",
                            "original": "https://photorankmedia-a.akamaihd.net/media/w/v/d/wvd7rd4/original.jpg"
                        },
                        ...
                    },
                    {
                        "_links": {
                            "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/3042079980?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                            }
                        },
                        "id": "3042079980",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "harddrive",
                        "source_id": null,
                        "original_source": null,
                        "caption": "Acme Anvil on top of beautiful box",
                        "video_url": null,
                        "share_url": "https://acme.com/acme-anvil-50lb#opi3042079980",
                        "date_submitted": "2018-10-02T19:31:02+00:00",
                        "date_published": "2018-10-02T19:31:55+00:00",
                        "favorite": false,
                        "location": null,
                        "sonar_place": null,
                        "original_image_width": "1500",
                        "original_image_height": "1429",
                        "status": "approved",
                        "likes": 0,
                        "request_id": null,
                        "images": {
                            "square": "https://z3photorankmedia-a.akamaihd.net/media/u/v/d/uvd7rd4/square.jpg",
                            "thumbnail": "https://photorankmedia-a.akamaihd.net/media/u/v/d/uvd7rd4/thumbnail.jpg",
                            "mobile": "https://z1photorankmedia-a.akamaihd.net/media/u/v/d/uvd7rd4/mobile.jpg",
                            "normal": "https://photorankmedia-a.akamaihd.net/media/u/v/d/uvd7rd4/normal.jpg",
                            "original": "https://z3photorankmedia-a.akamaihd.net/media/u/v/d/uvd7rd4/original.jpg"
                        },
                        ...
                    },
                    {
                        "_links": {
                            "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/3042079979?auth_token=f48eeae508d1b1f3133df366679eb2b567bae5dc8058d69d679dc5cb140eb857&version=v2.2"
                            }
                        },
                        "id": "3042079979",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "harddrive",
                        "source_id": null,
                        "original_source": null,
                        "caption": "My shiny Acme Anvil!",
                        "video_url": null,
                        "share_url": "https://acme.com/acme-anvil-50lb#opi3042079979",
                        "date_submitted": "2018-10-02T19:31:01+00:00",
                        "date_published": "2018-10-02T19:31:53+00:00",
                        "favorite": false,
                        "location": null,
                        "sonar_place": null,
                        "original_image_width": "1092",
                        "original_image_height": "727",
                        "status": "approved",
                        "likes": 0,
                        "request_id": null,
                        "images": {
                            "square": "https://z2photorankmedia-a.akamaihd.net/media/t/v/d/tvd7rd4/square.jpg",
                            "thumbnail": "https://z3photorankmedia-a.akamaihd.net/media/t/v/d/tvd7rd4/thumbnail.jpg",
                            "mobile": "https://photorankmedia-a.akamaihd.net/media/t/v/d/tvd7rd4/mobile.jpg",
                            "normal": "https://z1photorankmedia-a.akamaihd.net/media/t/v/d/tvd7rd4/normal.jpg",
                            "original": "https://photorankmedia-a.akamaihd.net/media/t/v/d/tvd7rd4/original.jpg"
                        },
                        ...
                    }
                ],
                ...
            }
        }
    }
    

    Some object properties in the above example request response have been omitted for brevity.

    The total number of images tagged to the stream is 5. Each media object in the array contains a set of image URLs (data._embedded.media[n].images), as well as the associated stream objects associated with the media, within the data._embedded.media[n]._embedded.streams:all property.

You can also download our Postman collection to use with Postman for easy access to the different endpoints, methods and structuring of the API calls: Postman Collection

Customer Endpoints

The customer entity represents the Olapic’s customer. It is synonymous to the brand specific Olapic account.

The following endpoints will return data regarding the customer entity.

Get Customer by ID

Get a customer object by its unique id.

GET /customers/customer_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "domain": "{domain}",
    "template_dir": "{template_dir}",
    "language": "en_US",
    "settings": {
      "force_viewer_modal": false,
      "column_number": "3",
      "items_per_page": 10,
      "uploader_actions": "{uploader_actions}",
      "show_in_home": false,
      "show_in_home_id": "0",
      "force_https": false,
      "ab_testing": 0,
      "olapicU": "disabled",
      "customer_dependant": {
        "photos": "default",
        "facebook": "facebook2",
        "viewer": "{viewer}",
        "widget": "default",
        "admin": "default",
        "social": "default",
        "profile": "default",
        "default": "default",
        "bo": "default",
        "signup": "default",
        "api": "default",
        "developers": "default",
        "editor": "default",
        "slideshow": "default"
      },
      "analytics_cookie_domain": "{analytics_cookie_domain}",
      "premoderation": false,
      "tagging": false,
      "analytics_api_version": "{analytics_api_version}",
      "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
      "analytics_dashboard_engagement": false,
      "analytics_conversion_interval": "30-minutes",
      "currency": "$",
      "analytics_enterprise_analytics": false
    },
    "views": {
      "viewer": "{viewer}"
    },
    "_embedded": {
      "user": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/users/?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": false
      },
      "media": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        },
        "_fixed": false
      },
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        },
        "_fixed": false
      },
      "media:shuffled": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
          }
        },
        "_fixed": false
      },
      "media:photorank": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
          }
        },
        "_fixed": false
      },
      "media:rated": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
          }
        },
        "_fixed": false
      }
    },
    "_forms": {
      "streams:search": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
        },
        "method": "GET",
        "fields": [
          {
            "type": "text",
            "prompt": "Product ID",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      },
      "categories:search": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
        },
        "method": "GET",
        "fields": [
          {
            "type": "text",
            "prompt": "Tag",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      },
      "stashes:create": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/stashes"
        },
        "method": "POST",
        "fields": [
          {
            "type": "file",
            "prompt": "File",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      },
      "users:create": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/users"
        },
        "method": "POST",
        "fields": [
          {
            "type": "text",
            "prompt": "Email",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "text",
            "prompt": "Screen name",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "text",
            "prompt": "Avatar URL",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      }
    }
  }
}

HTTP Request

GET /customers/{customer_id}

Parameters

customer_id
<integer> (required) 

The unique id of the customer.


Media Endpoints

The media entity represents the media content Olapic gathers from various collection sources.

You can retrieve all media objects that are published in the Olapic Media Library. User generated content that are not yet published (content sitting in Moderation Queue) is not visible via this API.

For metadata keyword retrieval, please refer to the Content API documentation.

Media Sizing Options

For every media object returned in the request response, you can access the images property to retrieve the URLs of the image assets.

Example object:

{
    ...
    "id": "2233204727",
    "_fixed": true,
    "type": "IMAGE",
    "source": "instagram",
    "source_id": "993149623896032103_2050837223",
    "original_source": "https:\/\/instagram.com\/p\/3IYFItIsNn\/",
    ...
    "images": {
        "square": "https://z1photorankmedia-a.akamaihd.net/media/j/3/9/j3954r3/square.jpg",
        "thumbnail": "https://z2photorankmedia-a.akamaihd.net/media/j/3/9/j3954r3/thumbnail.jpg",
        "mobile": "https://z1photorankmedia-a.akamaihd.net/media/j/3/9/j3954r3/mobile.jpg",
        "normal": "https://photorankmedia-a.akamaihd.net/media/j/3/9/j3954r3/normal.jpg",
        "original": "https://z2photorankmedia-a.akamaihd.net/media/j/3/9/j3954r3/original.jpg"
    },
    ...
}

The images object property contains five different versions of the asset. Here are the specifications of each version of the asset:

  • square - 90x90px image. Cropped, does not maintain ratio.

  • thumbnail - 150x150px image. Maintains ratio

  • mobile - 320x320px image. Maintains ratio

  • normal - 640x640px image. Maintains ratio

  • original - Original image without modifications

Media Sorting Options

The sorting_option is used in requests where media lists are being returned. It changes the order of the media returned in the response. See below for the accepted parameter values and their definitions:

  • recent: sort the media list by chronological order (descending).

  • shuffled: sort the media list by random order. The randomness is recomputed every 30 minutes.

  • photorank: sort the media list by photorank score. This score is predicted by the Olapic Machine Learning algorithm when the media object is registered in the system.

  • rated: sort the media list by the current Click Thru Rate of the media. This sorting assumes that the CTR is equal to 1.0 for all the media that are uploaded in the last 7 days or less.

  • media_position: This parameter is only available when requesting media associated to a particular stream (see Get Media of a Stream). This option sorts the media in the exact position selected for each media for that stream, which is configurable in the Olapic Admin tool.

Get Media by ID

Get a media by its unique ID.

GET /media/media_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "type": "IMAGE",
    "source": "{source}",
    "source_id": "{source_id}",
    "original_source": "{original_source}",
    "caption": "{caption}",
    "video_url": "{video_url}",
    "share_url": "{share_url}",
    "date_submitted": "{date_submitted}",
    "date_published": "2013-05-21T09:59:29+00:00",
    "favorite": false,
    "location": "{location}",
    "sonar_place": "{sonar_place}",
    "original_image_width": "612",
    "original_image_height": "612",
    "status": "approved",
    "likes": 5,
    "request_id": "{request_id}",
    "images": {
      "square": "{square}",
      "thumbnail": "{thumbnail}",
      "mobile": "{mobile}",
      "normal": "{normal}",
      "original": "{original}"
    },
    "_embedded": {
      "uploader": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "avatar_url": "{avatar_url}",
        "language": "en_US",
        "username": "{username}",
        "social_connections": {
          "instagram": {
            "username": "{username}",
            "source_id": "{source_id}"
          }
        },
        "_embedded": {
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            }
          }
        },
        "_forms": {
          "media:upload": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Caption",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "streams:all": {
        "_fixed": true,
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
          }
        },
        "_embedded": {
          "stream": "{stream}"
        }
      },
      "categories:all": {
        "_fixed": true,
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
          }
        },
        "_embedded": {
          "category": "{category}"
        }
      }
    },
    "_forms": {
      "report": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
        },
        "method": "POST",
        "fields": [
          {
            "type": "email",
            "prompt": "Email",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "short-text",
            "prompt": "Reason",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "submit",
            "prompt": "{prompt}",
            "name": "{name}",
            "value": "Report",
            "placeholder": "{placeholder}"
          }
        ]
      }
    },
    "_analytics": {
      "oid": "{oid}",
      "t": "media",
      "meta": [
        "user_agent",
        "event_type",
        "is_mobile"
      ]
    }
  }
}

HTTP Request

GET /media/{media_id}

Parameters

media_id
<integer> (required) 

The ID of the media to be returned.


Get Media of a Customer

Get a list of media associated with the customer entity.

GET /customers/customer_id/media/sorting_option?rights_given=rights_given&include_tagged_galleries=include_tagged_galleries&filter_media_without_products=filter_media_without_products
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      }
    },
    "_embedded": {
      "media": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2015-08-07T17:36:26+00:00",
          "favorite": false,
          "location": {
            "latitude": 40.8663,
            "longitude": -74.6323
          },
          "sonar_place": "{sonar_place}",
          "original_image_width": "640",
          "original_image_height": "640",
          "status": "approved",
          "likes": 110,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "{language}",
              "username": "{username}",
              "social_connections": {
                "instagram": {
                  "username": "{username}",
                  "source_id": "{source_id}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "shop_button_url": "{shop_button_url}",
                    "share_url": "{share_url}",
                    "_embedded": {
                      "customer": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": false
                      },
                      "base_image": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "{date_published}",
                        "favorite": false,
                        "location": "{location}",
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "800",
                        "original_image_height": "800",
                        "status": "{status}",
                        "likes": 0,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": "{uploader}",
                          "streams:all": "{streams:all}",
                          "categories:all": "{categories:all}"
                        },
                        "_forms": "{_forms}",
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "cover_media": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "2015-06-01T19:45:36+00:00",
                        "favorite": false,
                        "location": {
                          "latitude": 33.5138,
                          "longitude": -112.067
                        },
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "640",
                        "original_image_height": "640",
                        "status": "approved",
                        "likes": 135,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                              }
                            },
                            "id": "{id}",
                            "_fixed": false
                          },
                          "streams:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "stream": "{stream}"
                            }
                          },
                          "categories:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "category": "{category}"
                            }
                          }
                        },
                        "_forms": {
                          "report": {
                            "title": "{title}",
                            "action": {
                              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                            },
                            "method": "POST",
                            "fields": [
                              {
                                "type": "email",
                                "prompt": "Email",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "short-text",
                                "prompt": "Reason",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "submit",
                                "prompt": "{prompt}",
                                "name": "{name}",
                                "value": "Report",
                                "placeholder": "{placeholder}"
                              }
                            ]
                          }
                        },
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:media_position": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    },
                    "name": "{name}",
                    "description": "{description}",
                    "tag_based_key": "{tag_based_key}",
                    "product_url": "{product_url}",
                    "hide_from_related": false,
                    "product_info": {
                      "price": "28.00",
                      "availability": "true",
                      "stock": "{stock}",
                      "color": "Rafaelian Gold Finish,Rafaelian Silver Finish,"
                    },
                    "_analytics": {
                      "oid": "{oid}",
                      "t": "gallery",
                      "meta": [
                        "user_agent",
                        "event_type",
                        "is_mobile"
                      ]
                    }
                  }
                ]
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": "{category}"
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2015-08-07T17:28:56+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "640",
          "original_image_height": "640",
          "status": "approved",
          "likes": 13,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "{language}",
              "username": "{username}",
              "social_connections": {
                "instagram": {
                  "username": "{username}",
                  "source_id": "{source_id}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "shop_button_url": "{shop_button_url}",
                    "share_url": "{share_url}",
                    "_embedded": {
                      "customer": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": false
                      },
                      "base_image": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "{date_published}",
                        "favorite": false,
                        "location": "{location}",
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "800",
                        "original_image_height": "800",
                        "status": "{status}",
                        "likes": 0,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": "{uploader}",
                          "streams:all": "{streams:all}",
                          "categories:all": "{categories:all}"
                        },
                        "_forms": "{_forms}",
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "cover_media": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "2015-06-01T19:45:36+00:00",
                        "favorite": false,
                        "location": {
                          "latitude": 33.5138,
                          "longitude": -112.067
                        },
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "640",
                        "original_image_height": "640",
                        "status": "approved",
                        "likes": 135,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                              }
                            },
                            "id": "{id}",
                            "_fixed": false
                          },
                          "streams:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "stream": "{stream}"
                            }
                          },
                          "categories:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "category": "{category}"
                            }
                          }
                        },
                        "_forms": {
                          "report": {
                            "title": "{title}",
                            "action": {
                              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                            },
                            "method": "POST",
                            "fields": [
                              {
                                "type": "email",
                                "prompt": "Email",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "short-text",
                                "prompt": "Reason",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "submit",
                                "prompt": "{prompt}",
                                "name": "{name}",
                                "value": "Report",
                                "placeholder": "{placeholder}"
                              }
                            ]
                          }
                        },
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:media_position": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    },
                    "name": "{name}",
                    "description": "{description}",
                    "tag_based_key": "{tag_based_key}",
                    "product_url": "{product_url}",
                    "hide_from_related": false,
                    "product_info": {
                      "price": "28.00",
                      "availability": "true",
                      "stock": "{stock}",
                      "color": "Rafaelian Gold Finish,Rafaelian Silver Finish,"
                    },
                    "_analytics": {
                      "oid": "{oid}",
                      "t": "gallery",
                      "meta": [
                        "user_agent",
                        "event_type",
                        "is_mobile"
                      ]
                    }
                  }
                ]
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": "{category}"
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ],
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": true,
          "column_number": "4",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "bestphotos",
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "widget2",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": true,
          "tagging": true,
          "analytics_api_version": "v1",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      }
    }
  }
}

HTTP Request

GET /customers/{customer_id}/media/{sorting_option}?rights_given={rights_given}&include_tagged_galleries={include_tagged_galleries}&filter_media_without_products={filter_media_without_products}

Parameters

customer_id
<integer> (required) 

The id of the customer which is the owner of the media.

sorting_option
<string> (required) 

Changes the order of the media returned in the response. See Media Sorting Options for more details.

rights_given
<boolean> (optional) 

Filters media objects by their rights status. Accepted values are 0 (default) or 1. If 1 is provided for this parameter, only media with rights associated will be returned, and media without rights will be excluded from the list.

include_tagged_galleries
<boolean> (optional) 

Filters embedded streams with status TAG. Accepted values are 0 or 1 (default). If 0 is provided for this parameter, streams with status TAG will be removed from the embedded objects in the response.

filter_media_without_products
<boolean> (optional) 

Filters out media which are not tagged to in-stock products. Accepted values are 0 (default) or 1. If 1 is provided for this parameter, only media tagged to at least one stream with status OK will be included in the response.


Get Media of a Category

Get the media collection related to a category using the selected sorting_option.

GET /categories/category_id/media/sorting_option?rights_given=rights_given&include_tagged_galleries=include_tagged_galleries&filter_media_without_products=filter_media_without_products
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "{href}"
      }
    },
    "_embedded": {
      "media": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2014-03-18T18:09:34+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "640",
          "original_image_height": "640",
          "status": "approved",
          "likes": 23,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "en_US",
              "username": "{username}",
              "social_connections": {
                "instagram": {
                  "username": "{username}",
                  "source_id": "{source_id}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "shop_button_url": "{shop_button_url}",
                    "share_url": "{share_url}",
                    "_embedded": {
                      "customer": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": false
                      },
                      "base_image": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "{date_published}",
                        "favorite": false,
                        "location": "{location}",
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "600",
                        "original_image_height": "860",
                        "status": "{status}",
                        "likes": 0,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": "{uploader}",
                          "streams:all": "{streams:all}",
                          "categories:all": "{categories:all}"
                        },
                        "_forms": "{_forms}",
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "cover_media": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "2014-03-18T18:09:34+00:00",
                        "favorite": false,
                        "location": "{location}",
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "640",
                        "original_image_height": "640",
                        "status": "approved",
                        "likes": 23,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                              }
                            },
                            "id": "{id}",
                            "_fixed": false
                          },
                          "streams:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "stream": "{stream}"
                            }
                          },
                          "categories:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "category": "{category}"
                            }
                          }
                        },
                        "_forms": {
                          "report": {
                            "title": "{title}",
                            "action": {
                              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                            },
                            "method": "POST",
                            "fields": [
                              {
                                "type": "email",
                                "prompt": "Email",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "short-text",
                                "prompt": "Reason",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "submit",
                                "prompt": "{prompt}",
                                "name": "{name}",
                                "value": "Report",
                                "placeholder": "{placeholder}"
                              }
                            ]
                          }
                        },
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:media_position": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    },
                    "name": "{name}",
                    "description": "{description}",
                    "tag_based_key": "{tag_based_key}",
                    "product_url": "{product_url}",
                    "hide_from_related": false,
                    "product_info": {
                      "price": "{price}",
                      "availability": "{availability}",
                      "stock": "{stock}",
                      "color": "{color}"
                    },
                    "_analytics": {
                      "oid": "{oid}",
                      "t": "gallery",
                      "meta": [
                        "user_agent",
                        "event_type",
                        "is_mobile"
                      ]
                    }
                  }
                ]
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "name": "{name}",
                    "key": "{key}",
                    "product_url": "{product_url}",
                    "settings": "{settings}",
                    "_embedded": {
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    }
                  },
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "name": "{name}",
                    "key": "{key}",
                    "product_url": "{product_url}",
                    "settings": "{settings}",
                    "_embedded": {
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2013-11-04T19:00:46+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "640",
          "original_image_height": "640",
          "status": "approved",
          "likes": 77,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "en_US",
              "username": "{username}",
              "social_connections": {
                "instagram": {
                  "username": "{username}",
                  "source_id": "{source_id}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "shop_button_url": "{shop_button_url}",
                    "share_url": "{share_url}",
                    "_embedded": {
                      "customer": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": false
                      },
                      "base_image": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "{date_published}",
                        "favorite": false,
                        "location": "{location}",
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "600",
                        "original_image_height": "860",
                        "status": "{status}",
                        "likes": 0,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": "{uploader}",
                          "streams:all": "{streams:all}",
                          "categories:all": "{categories:all}"
                        },
                        "_forms": "{_forms}",
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "cover_media": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "2013-06-26T21:23:02+00:00",
                        "favorite": false,
                        "location": {
                          "latitude": 34.0147,
                          "longitude": -118.495
                        },
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "612",
                        "original_image_height": "612",
                        "status": "approved",
                        "likes": 189,
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                              }
                            },
                            "id": "{id}",
                            "_fixed": false
                          },
                          "streams:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "stream": "{stream}"
                            }
                          },
                          "categories:all": {
                            "_fixed": true,
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "category": "{category}"
                            }
                          }
                        },
                        "_forms": {
                          "report": {
                            "title": "{title}",
                            "action": {
                              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                            },
                            "method": "POST",
                            "fields": [
                              {
                                "type": "email",
                                "prompt": "Email",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "short-text",
                                "prompt": "Reason",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "submit",
                                "prompt": "{prompt}",
                                "name": "{name}",
                                "value": "Report",
                                "placeholder": "{placeholder}"
                              }
                            ]
                          }
                        },
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:media_position": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    },
                    "name": "{name}",
                    "description": "{description}",
                    "tag_based_key": "{tag_based_key}",
                    "product_url": "{product_url}",
                    "hide_from_related": false,
                    "product_info": {
                      "price": "{price}",
                      "availability": "{availability}",
                      "stock": "{stock}",
                      "color": "{color}"
                    },
                    "_analytics": {
                      "oid": "{oid}",
                      "t": "gallery",
                      "meta": [
                        "user_agent",
                        "event_type",
                        "is_mobile"
                      ]
                    }
                  }
                ]
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "name": "{name}",
                    "key": "{key}",
                    "product_url": "{product_url}",
                    "settings": "{settings}",
                    "_embedded": {
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    }
                  },
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "name": "{name}",
                    "key": "{key}",
                    "product_url": "{product_url}",
                    "settings": "{settings}",
                    "_embedded": {
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ],
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "5",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "bestphotos",
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "enabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "widget2",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v1",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      }
    }
  }
}

HTTP Request

GET /categories/{category_id}/media/{sorting_option}?rights_given={rights_given}&include_tagged_galleries={include_tagged_galleries}&filter_media_without_products={filter_media_without_products}

Parameters

category_id
<integer> (required) 

The id of the category related to the media.

sorting_option
<string> (required) 

Changes the order of the media returned in the response. See Media Sorting Options for more details.

rights_given
<boolean> (optional) 

Filters media without rights.

include_tagged_galleries
<boolean> (optional) 

Filters embedded streams with status TAG.

filter_media_without_products
<boolean> (optional) 

Filters out media which are not tagged to in-stock products. Accepted values are 0 (default) or 1. If 1 is provided for this parameter, only media tagged to at least one stream with status OK will be included in the response.


Get Media of a Stream

Get the media collection related to a stream using the selected sorting_option.

GET /streams/stream_id/media/sorting_option?rights_given=rights_given&include_tagged_galleries=include_tagged_galleries&filter_media_without_products=filter_media_without_products
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?count={count}&auth_token={auth_token}&version={version}"
      },
      "first": {
        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?count={count}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?prev_id={prev_id}&count={count}&auth_token={auth_token}&version={version}"
      }
    },
    "_embedded": {
      "media": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2015-10-29T23:05:36+00:00",
          "favorite": false,
          "location": {
            "latitude": -8.80271,
            "longitude": 115.234
          },
          "sonar_place": {
            "id": "{id}",
            "instagram_location": {
              "id": "{id}",
              "hash": "630f3af11cabec3d8078b2c0496e673b",
              "name": "{name}"
            },
            "source": {
              "provider_hash": "e6387197f3a8fbeb4a9ba271c7376d11",
              "provider_id": "138630096158683",
              "name": "{name}",
              "url": "https://www.facebook.com/GrandHyattBali",
              "provider_name": "facebook"
            },
            "name": "{name}",
            "geopoint": {
              "lon": 115.23416058,
              "lat": -8.80270606
            },
            "url": "https://www.facebook.com/GrandHyattBali",
            "name_raw": "Grand Hyatt Bali"
          },
          "original_image_width": "640",
          "original_image_height": "640",
          "status": "approved",
          "likes": "53",
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "{language}",
              "username": "{username}",
              "social_connections": {
                "instagram": {
                  "source_id": "{source_id}",
                  "username": "{username}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//rest.photorank.me/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_fixed": true,
              "_embedded": {
                "stream": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "name": "{name}",
                    "description": "{description}",
                    "tag_based_key": "{tag_based_key}",
                    "product_url": "{product_url}",
                    "hide_from_related": false,
                    "shop_button_url": "{shop_button_url}",
                    "_embedded": {
                      "base_image": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "{date_published}",
                        "favorite": false,
                        "location": "{location}",
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "225",
                        "original_image_height": "73",
                        "status": "{status}",
                        "likes": "{likes}",
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": "{uploader}",
                          "streams:all": "{streams:all}",
                          "categories:all": "{categories:all}"
                        },
                        "_forms": "{_forms}",
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "cover_media": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                          }
                        },
                        "id": "{id}",
                        "_fixed": true,
                        "type": "IMAGE",
                        "source": "{source}",
                        "source_id": "{source_id}",
                        "original_source": "{original_source}",
                        "caption": "{caption}",
                        "video_url": "{video_url}",
                        "share_url": "{share_url}",
                        "date_submitted": "{date_submitted}",
                        "date_published": "2013-01-16T16:43:44+00:00",
                        "favorite": false,
                        "location": {
                          "latitude": 40.7074,
                          "longitude": -73.9482
                        },
                        "sonar_place": "{sonar_place}",
                        "original_image_width": "612",
                        "original_image_height": "612",
                        "status": "approved",
                        "likes": "2",
                        "request_id": "{request_id}",
                        "images": {
                          "square": "{square}",
                          "thumbnail": "{thumbnail}",
                          "mobile": "{mobile}",
                          "normal": "{normal}",
                          "original": "{original}"
                        },
                        "_embedded": {
                          "uploader": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                              }
                            },
                            "id": "{id}",
                            "_fixed": false
                          },
                          "streams:all": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "stream": "{stream}"
                            }
                          },
                          "categories:all": {
                            "_links": {
                              "self": {
                                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                              }
                            },
                            "_embedded": {
                              "category": "{category}"
                            }
                          }
                        },
                        "_forms": {
                          "report": {
                            "title": "{title}",
                            "action": {
                              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                            },
                            "method": "POST",
                            "fields": [
                              {
                                "type": "email",
                                "prompt": "Email",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "short-text",
                                "prompt": "Reason",
                                "name": "{name}",
                                "value": "{value}",
                                "placeholder": "{placeholder}"
                              },
                              {
                                "type": "submit",
                                "prompt": "{prompt}",
                                "name": "{name}",
                                "value": "Report",
                                "placeholder": "{placeholder}"
                              }
                            ]
                          }
                        },
                        "_analytics": {
                          "oid": "{oid}",
                          "t": "media",
                          "meta": [
                            "user_agent",
                            "event_type",
                            "is_mobile"
                          ]
                        }
                      },
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:media_position": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    },
                    "product_info": {
                      "price": "{price}",
                      "availability": "{availability}",
                      "stock": "{stock}",
                      "color": "{color}"
                    },
                    "_analytics": {
                      "oid": "{oid}",
                      "t": "gallery",
                      "meta": [
                        "user_agent",
                        "event_type",
                        "is_mobile"
                      ]
                    }
                  }
                ]
              }
            },
            "categories:all": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_fixed": true,
              "_embedded": {
                "category": [
                  {
                    "_links": {
                      "self": {
                        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
                      }
                    },
                    "id": "{id}",
                    "_fixed": true,
                    "name": "{name}",
                    "key": "{key}",
                    "product_url": "{product_url}",
                    "settings": "{settings}",
                    "_embedded": {
                      "media:recent": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:shuffled": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:photorank": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                          }
                        }
                      },
                      "media:rated": {
                        "_links": {
                          "self": {
                            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                          }
                        }
                      }
                    }
                  }
                ]
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ],
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "4",
          "items_per_page": "8",
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "galleries",
          "show_in_home_id": 0,
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "widget2",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v2",
          "analytics_checkout_file_prefix": "v2",
          "analytics_dashboard_engagement": true
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//rest.photorank.me/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//rest.photorank.me/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      }
    }
  }
}

HTTP Request

GET /streams/{stream_id}/media/{sorting_option}?rights_given={rights_given}&include_tagged_galleries={include_tagged_galleries}&filter_media_without_products={filter_media_without_products}

Parameters

stream_id
<integer> (required) 

The id of the stream related to the media.

sorting_option
<string> (required) 

Changes the order of the media returned in the response. See Media Sorting Options for more details.

rights_given
<boolean> (optional) 

Filters media without rights.

include_tagged_galleries
<boolean> (optional) 

Filters embedded streams with status TAG.

filter_media_without_products
<boolean> (optional) 

Filters out media which are not tagged to in-stock products. Accepted values are 0 (default) or 1. If 1 is provided for this parameter, only media tagged to at least one stream with status OK will be included in the response.


Get Media of a User by ID

Get the media collection uploaded by a user using recent sorting option.

Note that the recent sorting option is the only option available for this endpoint.

GET /users/user_id/media/recent
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "{href}"
      }
    },
    "_embedded": {
      "media": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2012-09-24T14:51:47+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "304",
          "original_image_height": "360",
          "status": "approved",
          "likes": 0,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": false
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": "{stream}"
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": "{category}"
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2012-09-24T14:15:41+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "400",
          "original_image_height": "300",
          "status": "approved",
          "likes": 0,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": false
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": "{stream}"
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": "{category}"
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ],
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "5",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": false,
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "photos": "default",
            "facebook": "facebook2",
            "viewer": "{viewer}",
            "widget": "default",
            "uploader": "{uploader}",
            "premoderation": "default",
            "docs": "default",
            "editor": "editorv2",
            "slideshow": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "{analytics_api_version}",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      }
    }
  }
}

HTTP Request

GET /users/{user_id}/media/recent

Parameters

user_id
<integer> (required) 

The id of the user which has uploaded the media.


Get Media of a User by Instagram username

Get the media collection uploaded by a user using recent sorting option.

Note that the recent sorting option is the only option available for this endpoint.

GET /customers/customer_id/instagram_users/instagram_handle/media/recent
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/instagram_users/{instagram_handle}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/instagram_users/{instagram_handle}/media/recent?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "{href}"
      }
    },
    "_embedded": {
      "media": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2013-06-24T15:59:44+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "612",
          "original_image_height": "612",
          "status": "approved",
          "likes": 0,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "en_US",
              "username": "{instagram_handle}",
              "social_connections": {
                "instagram": {
                  "username": "{instagram_handle}",
                  "source_id": "{source_id}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": "{stream}"
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": "{category}"
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "IMAGE",
          "source": "{source}",
          "source_id": "{source_id}",
          "original_source": "{original_source}",
          "caption": "{caption}",
          "video_url": "{video_url}",
          "share_url": "{share_url}",
          "date_submitted": "{date_submitted}",
          "date_published": "2013-06-24T15:59:44+00:00",
          "favorite": false,
          "location": "{location}",
          "sonar_place": "{sonar_place}",
          "original_image_width": "612",
          "original_image_height": "612",
          "status": "approved",
          "likes": 0,
          "request_id": "{request_id}",
          "images": {
            "square": "{square}",
            "thumbnail": "{thumbnail}",
            "mobile": "{mobile}",
            "normal": "{normal}",
            "original": "{original}"
          },
          "_embedded": {
            "uploader": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "name": "{name}",
              "avatar_url": "{avatar_url}",
              "language": "en_US",
              "username": "{instagram_handle}",
              "social_connections": {
                "instagram": {
                  "username": "{instagram_handle}",
                  "source_id": "{source_id}"
                }
              },
              "_embedded": {
                "media:recent": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
                    }
                  }
                }
              },
              "_forms": {
                "media:upload": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "text",
                      "prompt": "Caption",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "text",
                      "prompt": "URL",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              }
            },
            "streams:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "stream": "{stream}"
              }
            },
            "categories:all": {
              "_fixed": true,
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                }
              },
              "_embedded": {
                "category": "{category}"
              }
            }
          },
          "_forms": {
            "report": {
              "title": "{title}",
              "action": {
                "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
              },
              "method": "POST",
              "fields": [
                {
                  "type": "email",
                  "prompt": "Email",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "short-text",
                  "prompt": "Reason",
                  "name": "{name}",
                  "value": "{value}",
                  "placeholder": "{placeholder}"
                },
                {
                  "type": "submit",
                  "prompt": "{prompt}",
                  "name": "{name}",
                  "value": "Report",
                  "placeholder": "{placeholder}"
                }
              ]
            }
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "media",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ],
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "4",
          "items_per_page": 8,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "galleries",
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "widget2",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": true,
          "analytics_api_version": "v2",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": true,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      }
    }
  }
}

HTTP Request

GET /customers/{customer_id}/instagram_users/{instagram_handle}/media/recent

Parameters

customer_id
<integer> (required) 

The id of the customer which is executing the request.

instagram_handle
<string> (required) 

The Instagram username of the user which has uploaded the media.


Report Media

Report a media via the API.

This endpoint allows you to report a media object using a media ID. Reporting a media moves the published media to the Moderation Queue of the Olapic Admin.

API Caching

Due to the CDN cache of the API, the reported content may persist in the GET request responses until the cache fully propagates.

POST /media/media_id/reports
Responses201
Response
{
  "metadata": {
    "code": 201,
    "message": "Created",
    "version": "v2.0"
  }
}

HTTP Request

POST /media/{media_id}/reports

Parameters

media_id
<integer> (required) 

The id of the media.

email
<string> (required) 

The email address of the reporter.

reason
<string> (required) 

The reason why this media is being reported.


Upload Media

Upload a media object for a user.

POST /users/user_id/media
Responses200
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "type": "IMAGE",
    "source": "{source}",
    "source_id": "{source_id}",
    "original_source": "{original_source}",
    "caption": "{caption}",
    "video_url": "{video_url}",
    "share_url": "{share_url}",
    "date_submitted": "{date_submitted}",
    "date_published": "{date_published}",
    "favorite": false,
    "location": {
      "latitude": 80,
      "longitude": 110.1
    },
    "sonar_place": "{sonar_place}",
    "original_image_width": "{original_image_width}",
    "original_image_height": "{original_image_height}",
    "status": "pending",
    "likes": 0,
    "request_id": "{request_id}",
    "images": {
      "square": "{square}",
      "thumbnail": "{thumbnail}",
      "mobile": "{mobile}",
      "normal": "{normal}",
      "original": "{original}"
    },
    "_embedded": {
      "uploader": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "avatar_url": "{avatar_url}",
        "language": "en_US",
        "username": "{username}",
        "social_connections": [],
        "_embedded": {
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            }
          }
        },
        "_forms": {
          "media:upload": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Caption",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "streams:all": {
        "_fixed": true,
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
          }
        },
        "_embedded": {
          "stream": "{stream}"
        }
      },
      "categories:all": {
        "_fixed": true,
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
          }
        },
        "_embedded": {
          "category": "{category}"
        }
      }
    },
    "_forms": {
      "report": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
        },
        "method": "POST",
        "fields": [
          {
            "type": "email",
            "prompt": "Email",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "short-text",
            "prompt": "Reason",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "submit",
            "prompt": "{prompt}",
            "name": "{name}",
            "value": "Report",
            "placeholder": "{placeholder}"
          }
        ]
      }
    },
    "_analytics": {
      "oid": "{oid}",
      "t": "media",
      "meta": [
        "user_agent",
        "event_type",
        "is_mobile"
      ]
    }
  }
}

HTTP Request

POST /users/{user_id}/media

Caution

If the value for url or file is missing, then the request will not be honored by the server. One of the two fields must be present for the API to consume data. In other words, these fields are mutually exclusive (only one of the parameters should be provided).

Form-data vs. Query String

Note that the only parameter to be filled out in the URL is the user_id. The rest of the parameters should be sent as form-data fields.

Parameters

user_id
<integer> (required) 

The associated ID of the user. This will be the user ID that will be associated to the uploaded media content.

file
<file> (required) 

The file to be uploaded. This parameter should be part of the form-data field.

url
<string> (required) 

The url of a previously stashed file. See Stash a Media section for more details.

caption
<string> (optional) 

The caption of the media.

stream_uri
<string> (optional) 

The URI of the stream to relate the media. See Get Stream by ID section for more details.

latitude
<float> (optional) 

The geographic latitude of the content. longitude must be provided along with this parameter.

longitude
<float> (optional) 

The geographic longitude of the content. latitude must be provided along with this parameter.


Stash Media

Stash a media for later consumption. This is to be used in junction with the Upload Media endpoint. Use /stashes/{stash_id} from the response as the url for the Upload Media section.

POST /stashes
Responses200
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/stashes/{stash_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true
  }
}

HTTP Request

POST /stashes

Form-data

The below parameter should be sent as a form-data field.

Parameters

file
<file> (required) 

The file to be stashed.


Stream Endpoints

The stream entity represents stream objects that are created in your Olapic account. Streams can be thought of as “folders” or “buckets” that can be used to organize media content.

A media object must always be associated with at least one stream object. Media object can be associated with many streams as well.

Get Stream by ID

Get a stream by its unique ID.

GET /streams/stream_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "shop_button_url": "{shop_button_url}",
    "share_url": "{share_url}",
    "_embedded": {
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "3",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "galleries",
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "photos": "default",
            "facebook": "facebook2",
            "viewer": "{viewer}",
            "widget": "default",
            "uploader": "{uploader}",
            "premoderation": "default",
            "docs": "default",
            "editor": "editorv2",
            "slideshow": "default",
            "assets": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "{analytics_api_version}",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "base_image": "{base_image}",
      "cover_media": "{cover_media}",
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:shuffled": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:photorank": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:rated": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:media_position": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
          }
        }
      }
    },
    "name": "{name}",
    "description": "{description}",
    "tag_based_key": "{tag_based_key}",
    "product_url": "{product_url}",
    "hide_from_related": false,
    "product_info": {
      "price": "{price}",
      "availability": "{availability}",
      "stock": "{stock}",
      "color": "{color}"
    },
    "_analytics": {
      "oid": "{oid}",
      "t": "gallery",
      "meta": [
        "user_agent",
        "event_type",
        "is_mobile"
      ]
    }
  }
}

HTTP Request

GET /streams/{stream_id}

Parameters

stream_id
<integer> (required) 

The ID of the stream.


Search Stream by Key

Get a stream by its unique key.

Note that stream ID and stream key are different concepts. When referring to stream ID, it means the Olapic Stream ID which is the primary key, which is what Olapic uses to identify streams. The stream key refers to the foreign key that a client would often retain on their data warehouse.

You can also send this request using the following endpoint alias: /customers/{customer_id}/streams/bytag/{key}.

Once your product feed is ingested in your Olapic account, you can use this endpoint to retrieve the associated stream object specific to a product ID in your environment.

GET /customers/customer_id/streams/search?tag_key=key
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "shop_button_url": "{shop_button_url}",
    "share_url": "{share_url}",
    "_embedded": {
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "3",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": false,
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "default",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v1",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "base_image": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "type": "IMAGE",
        "source": "{source}",
        "source_id": "{source_id}",
        "original_source": "{original_source}",
        "caption": "{caption}",
        "video_url": "{video_url}",
        "share_url": "{share_url}",
        "date_submitted": "{date_submitted}",
        "date_published": "{date_published}",
        "favorite": false,
        "location": "{location}",
        "sonar_place": "{sonar_place}",
        "original_image_width": "439",
        "original_image_height": "659",
        "status": "{status}",
        "likes": 0,
        "request_id": "{request_id}",
        "images": {
          "square": "{square}",
          "thumbnail": "{thumbnail}",
          "mobile": "{mobile}",
          "normal": "{normal}",
          "original": "{original}"
        },
        "_embedded": {
          "uploader": "{uploader}",
          "streams:all": "{streams:all}",
          "categories:all": "{categories:all}"
        },
        "_forms": "{_forms}",
        "_analytics": {
          "oid": "{oid}",
          "t": "media",
          "meta": [
            "user_agent",
            "event_type",
            "is_mobile"
          ]
        }
      },
      "cover_media": "{cover_media}",
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:shuffled": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:photorank": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:rated": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:media_position": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
          }
        }
      }
    },
    "name": "{name}",
    "description": "{description}",
    "tag_based_key": "{tag_based_key}",
    "product_url": "{product_url}",
    "hide_from_related": false,
    "product_info": {
      "price": "{price}",
      "availability": "{availability}",
      "stock": "{stock}",
      "color": "{color}"
    },
    "_analytics": {
      "oid": "{oid}",
      "t": "gallery",
      "meta": [
        "user_agent",
        "event_type",
        "is_mobile"
      ]
    }
  }
}

HTTP Request

GET /customers/{customer_id}/streams/search?tag_key={key}

Parameters

customer_id
<integer> (required) 

The id of the customer which is executing the request.

key
<integer> (required) 

The corresponding key of the stream object.


Get Streams of Customer

Get a list of stream objects related to a customer.

GET /customers/customer_id/streams
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams?count={count}&auth_token={auth_token}&version={version}"
      },
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams?count={count}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams?prev_id={prev_id}&count={count}&auth_token={auth_token}&version={version}"
      }
    },
    "_embedded": {
      "gallery": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "description": "{description}",
          "tag_based_key": "{tag_based_key}",
          "product_url": "{product_url}",
          "hide_from_related": false,
          "_embedded": {
            "base_image": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "{date_published}",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "200",
              "original_image_height": "200",
              "status": "{status}",
              "likes": "{likes}",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": "{uploader}",
                "streams:all": "{streams:all}",
                "categories:all": "{categories:all}"
              },
              "_forms": "{_forms}",
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "cover_media": "{cover_media}",
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:media_position": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "product_info": {
            "price": "{price}",
            "availability": "{availability}",
            "stock": "{stock}",
            "color": "{color}"
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "gallery",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "description": "{description}",
          "tag_based_key": "{tag_based_key}",
          "product_url": "{product_url}",
          "hide_from_related": false,
          "_embedded": {
            "base_image": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "{date_published}",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "200",
              "original_image_height": "200",
              "status": "{status}",
              "likes": "{likes}",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": "{uploader}",
                "streams:all": "{streams:all}",
                "categories:all": "{categories:all}"
              },
              "_forms": "{_forms}",
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "cover_media": "{cover_media}",
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:media_position": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "product_info": {
            "price": "{price}",
            "availability": "{availability}",
            "stock": "{stock}",
            "color": "{color}"
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "gallery",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ]
    }
  }
}

HTTP Request

GET /customers/{customer_id}/streams

Parameters

customer_id
<integer> (required) 

The id of the customer which is executing the request.


Get Streams of Media

Get a list of stream objects related to a media.

Caution

Any streams with the status TAG will not be listed in this request.

GET /media/media_id/streams
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": [],
    "_embedded": {
      "stream": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "description": "{description}",
          "tag_based_key": "{tag_based_key}",
          "product_url": "{product_url}",
          "hide_from_related": false,
          "_embedded": {
            "base_image": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "{date_published}",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "200",
              "original_image_height": "200",
              "status": "{status}",
              "likes": "{likes}",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": "{uploader}",
                "streams:all": "{streams:all}",
                "categories:all": "{categories:all}"
              },
              "_forms": "{_forms}",
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "cover_media": "{cover_media}",
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:media_position": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "product_info": {
            "price": "{price}",
            "availability": "{availability}",
            "stock": "{stock}",
            "color": "{color}"
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "gallery",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "description": "{description}",
          "tag_based_key": "{tag_based_key}",
          "product_url": "{product_url}",
          "hide_from_related": false,
          "_embedded": {
            "base_image": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "{date_published}",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "200",
              "original_image_height": "200",
              "status": "{status}",
              "likes": "{likes}",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": "{uploader}",
                "streams:all": "{streams:all}",
                "categories:all": "{categories:all}"
              },
              "_forms": "{_forms}",
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "cover_media": "{cover_media}",
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:media_position": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "product_info": {
            "price": "{price}",
            "availability": "{availability}",
            "stock": "{stock}",
            "color": "{color}"
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "gallery",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ]
    }
  }
}

HTTP Request

GET /media/{media_id}/streams

Parameters

media_id
<integer> (required) 

The id of the media which is related to the streams.


Streams of a Category

Get a list of stream objects related to a category.

GET /categories/category_id/streams
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/streams?count={count}&auth_token={auth_token}&version={version}"
      },
      "first": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/streams?count={count}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/streams?prev_id={prev_id}&count={count}&auth_token={auth_token}&version={version}"
      }
    },
    "_embedded": {
      "gallery": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "description": "{description}",
          "tag_based_key": "{tag_based_key}",
          "product_url": "{product_url}",
          "hide_from_related": false,
          "_embedded": {
            "base_image": "{base_image}",
            "cover_media": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "2014-03-18T22:53:06+00:00",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "640",
              "original_image_height": "640",
              "status": "approved",
              "likes": "4",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                    }
                  },
                  "id": "{id}",
                  "_fixed": false
                },
                "streams:all": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                    }
                  },
                  "_embedded": {
                    "stream": "{stream}"
                  }
                },
                "categories:all": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                    }
                  },
                  "_embedded": {
                    "category": "{category}"
                  }
                }
              },
              "_forms": {
                "report": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "email",
                      "prompt": "Email",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "short-text",
                      "prompt": "Reason",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "submit",
                      "prompt": "{prompt}",
                      "name": "{name}",
                      "value": "Report",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              },
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:media_position": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "product_info": {
            "price": "{price}",
            "availability": "{availability}",
            "stock": "{stock}",
            "color": "{color}"
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "gallery",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "description": "{description}",
          "tag_based_key": "{tag_based_key}",
          "product_url": "{product_url}",
          "hide_from_related": false,
          "_embedded": {
            "base_image": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "{date_published}",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "1000",
              "original_image_height": "1201",
              "status": "{status}",
              "likes": "{likes}",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": "{uploader}",
                "streams:all": "{streams:all}",
                "categories:all": "{categories:all}"
              },
              "_forms": "{_forms}",
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "cover_media": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/media/{medium_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": true,
              "type": "IMAGE",
              "source": "{source}",
              "source_id": "{source_id}",
              "original_source": "{original_source}",
              "caption": "{caption}",
              "video_url": "{video_url}",
              "share_url": "{share_url}",
              "date_submitted": "{date_submitted}",
              "date_published": "2014-03-07T21:24:39+00:00",
              "favorite": false,
              "location": "{location}",
              "sonar_place": "{sonar_place}",
              "original_image_width": "318",
              "original_image_height": "200",
              "status": "approved",
              "likes": "{likes}",
              "request_id": "{request_id}",
              "images": {
                "square": "{square}",
                "thumbnail": "{thumbnail}",
                "mobile": "{mobile}",
                "normal": "{normal}",
                "original": "{original}"
              },
              "_embedded": {
                "uploader": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
                    }
                  },
                  "id": "{id}",
                  "_fixed": false
                },
                "streams:all": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/streams?auth_token={auth_token}&version={version}"
                    }
                  },
                  "_embedded": {
                    "stream": "{stream}"
                  }
                },
                "categories:all": {
                  "_links": {
                    "self": {
                      "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/categories?auth_token={auth_token}&version={version}"
                    }
                  },
                  "_embedded": {
                    "category": "{category}"
                  }
                }
              },
              "_forms": {
                "report": {
                  "title": "{title}",
                  "action": {
                    "href": "//photorankapi-a.akamaihd.net/media/{medium_id}/reports"
                  },
                  "method": "POST",
                  "fields": [
                    {
                      "type": "email",
                      "prompt": "Email",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "short-text",
                      "prompt": "Reason",
                      "name": "{name}",
                      "value": "{value}",
                      "placeholder": "{placeholder}"
                    },
                    {
                      "type": "submit",
                      "prompt": "{prompt}",
                      "name": "{name}",
                      "value": "Report",
                      "placeholder": "{placeholder}"
                    }
                  ]
                }
              },
              "_analytics": {
                "oid": "{oid}",
                "t": "media",
                "meta": [
                  "user_agent",
                  "event_type",
                  "is_mobile"
                ]
              }
            },
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:media_position": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/streams/{stream_id}/media/media_position?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "product_info": {
            "price": "{price}",
            "availability": "{availability}",
            "stock": "{stock}",
            "color": "{color}"
          },
          "_analytics": {
            "oid": "{oid}",
            "t": "gallery",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ]
    }
  }
}

HTTP Request

GET /categories/{category_id}/streams

Parameters

category_id
<integer> (required) 

The id of the category which is related to the streams.


Category Endpoints

The category entity represents the category objects that are created in your Olapic account.

Categories can be thought of as groups of streams, and they can be created manually in your admin tool, or via the product feed ingestion.

The relationship between categories and streams are optional.

Get Category by ID

Get a category object by its unique id.

GET /categories/category_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "key": "{key}",
    "product_url": "{product_url}",
    "settings": {
      "meta_title": "{meta_title}",
      "meta_description": "{meta_description}",
      "meta_keywords": "{meta_keywords}",
      "meta_extras": "{meta_extras}"
    },
    "_embedded": {
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "3",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "bestphotos",
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "default",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v1",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:shuffled": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:photorank": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:rated": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
          }
        }
      }
    }
  }
}

HTTP Request

GET /categories/{category_id}

Parameters

category_id
<integer> (required) 

The id of the category to be returned.


Search Category by Key

Get a category object by its unique key.

Note that category ID and category key are different concepts. When referring to category ID, it means the Olapic Category ID which is the primary key, which is what Olapic uses to identify categories. The category key refers to the foreign key that a client would often retain on their data warehouse.

Once your product feed is ingested in your Olapic account, you can use this endpoint to retrieve the associated category object specific to a category key in your environment.

GET /customers/customer_id/categories/search?tag_key=key
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "key": "{key}",
    "product_url": "{product_url}",
    "settings": {
      "meta_title": "{meta_title}",
      "meta_description": "{meta_description}",
      "meta_keywords": "{meta_keywords}",
      "meta_extras": "{meta_extras}"
    },
    "_embedded": {
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": false,
          "column_number": "3",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": false,
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "default",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v1",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:shuffled": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:photorank": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
          }
        }
      },
      "media:rated": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
          }
        }
      }
    }
  }
}

HTTP Request

GET /customers/{customer_id}/categories/search?tag_key={key}

Parameters

customer_id
<integer> (required) 

The id of the customer which is executing the request.

key
<integer> (required) 

The corresponding key of the category object.


Get Categories of Customer

Get a list of category objects related to a customer.

GET /customers/customer_id/categories
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "{href}"
      }
    },
    "_embedded": {
      "category": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "key": "{key}",
          "product_url": "{product_url}",
          "settings": {
            "meta_title": "{meta_title}",
            "meta_description": "{meta_description}",
            "meta_keywords": "{meta_keywords}",
            "meta_extras": "{meta_extras}"
          },
          "_embedded": {
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            }
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "key": "{key}",
          "product_url": "{product_url}",
          "settings": {
            "meta_title": "{meta_title}",
            "meta_description": "{meta_description}",
            "meta_keywords": "{meta_keywords}",
            "meta_extras": "{meta_extras}"
          },
          "_embedded": {
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            }
          }
        }
      ]
    }
  }
}

HTTP Request

GET /customers/{customer_id}/categories

Parameters

customer_id
<integer> (required) 

The id of the customer.


Get Categories of Media

Get a list of category objects related to a media.

GET /media/media_id/categories
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": [],
    "_embedded": {
      "category": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "key": "{key}",
          "product_url": "{product_url}",
          "settings": "{settings}",
          "_embedded": {
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            }
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "key": "{key}",
          "product_url": "{product_url}",
          "settings": "{settings}",
          "_embedded": {
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            }
          }
        }
      ]
    }
  }
}

HTTP Request

GET /media/{media_id}/categories

Parameters

media_id
<integer> (required) 

The id of the media.


Get Categories of Stream

Get a list of category objects related to a stream.

GET /streams/stream_id/categories
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "{href}"
      }
    },
    "_embedded": {
      "category": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "key": "{key}",
          "product_url": "{product_url}",
          "settings": {
            "meta_title": "{meta_title}",
            "meta_description": "{meta_description}",
            "meta_keywords": "{meta_keywords}",
            "meta_extras": "{meta_extras}"
          },
          "_embedded": {
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            }
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "name": "{name}",
          "key": "{key}",
          "product_url": "{product_url}",
          "settings": {
            "meta_title": "{meta_title}",
            "meta_description": "{meta_description}",
            "meta_keywords": "{meta_keywords}",
            "meta_extras": "{meta_extras}"
          },
          "_embedded": {
            "media:recent": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/recent?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:shuffled": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/shuffled?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:photorank": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/photorank?auth_token={auth_token}&version={version}"
                }
              }
            },
            "media:rated": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}/media/rated?auth_token={auth_token}&version={version}"
                }
              }
            }
          }
        }
      ]
    }
  }
}

HTTP Request

GET /streams/{stream_id}/categories

Parameters

stream_id
<integer> (required) 

The id of the stream.


User Endpoints

The user entity represents the user objects that are associated with media entity objects.

Each media object must have a user object associated.

Social Connections

Note that all user objects in request responses include a parameter called social_connections. This parameter contains an object depending on the source of the content.

See below for different data models of request responses depending on the user source context:

If the content was collected from Instagram, the data model would look like:

...
"uploader":
    ...
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "en_US",
    "username": "{username}",
    "social_connections": {
      "instagram": {
        "username": "{username}",
        "source_id": "{source_id}"
      }
    },
...

If the content was collected from Twitter, the data model would look like:

...
"uploader":
    ...
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "en_US",
    "username": "{username}",
    "social_connections": {
      "twitter": {
        "username": "{username}",
        "source_id": "{source_id}"
      }
    },
...

In the case that there is no social connection established for a given user object, the API will return an empty array, like so:

...
"uploader":
    ...
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "en_US",
    "username": "{username}",
    "social_connections": [],
...

Get User by ID

Get a user by its unique id.

GET /users/user_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "{language}",
    "username": "{username}",
    "social_connections": [],
    "_embedded": {
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      }
    },
    "_forms": {
      "media:upload": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
        },
        "method": "POST",
        "fields": [
          {
            "type": "text",
            "prompt": "Caption",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "text",
            "prompt": "URL",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      }
    }
  }
}

HTTP Request

GET /users/{user_id}

Parameters

user_id
<integer> (required) 

The id of the user to be returned.


Get User by Instagram handle

Get a user by its associated Instagram username.

GET /customers/customer_id/instagram_users/instagram_handle
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "en_US",
    "username": "{instagram_handle}",
    "social_connections": {
      "instagram": {
        "username": "{instagram_handle}",
        "source_id": "{source_id}"
      }
    },
    "_embedded": {
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/instagram_users/{instagram_handle}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      }
    },
    "_forms": {
      "media:upload": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
        },
        "method": "POST",
        "fields": [
          {
            "type": "text",
            "prompt": "Caption",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "text",
            "prompt": "URL",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      }
    },
    "instagram_followers": "1297"
  }
}

HTTP Request

GET /customers/{customer_id}/instagram_users/{instagram_handle}

Parameters

customer_id
<integer> (required) 

The id of the customer executing the request`.

instagram_handle
<string> (required) 

The Instagram handle of the user.


Create a User

Create a user. Creating a user is a required step before uploading content to the Olapic API.

POST /users
Responses200
Response
{
  "metadata": {
    "code": 201,
    "message": "Created",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "en_US",
    "username": "{username}",
    "social_connections": [],
    "_embedded": {
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      }
    },
    "_forms": {
      "media:upload": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
        },
        "method": "POST",
        "fields": [
          {
            "type": "text",
            "prompt": "Caption",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "text",
            "prompt": "URL",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      }
    }
  }
}

HTTP Request

POST /users

Parameters

email
<string> (required) 

The email address of the user.

screen_name
<string> (required) 

The full name of the user. Note that this is different from user handle. User handle will be derived from the local-part of the email address provided.

avatar_url
<string> (optional) 

The avatar URL of the user. Avatar must be a valid image type jpg, gif, png and must be smaller than 5MB. If it is missing or avatar file does not fit the file type and size validations, then the default image URL will be used.


Update a User

Update a user. You can update a user's avatar or the user’s full name.

PUT /users/user_id
Responses200
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "name": "{name}",
    "avatar_url": "{avatar_url}",
    "language": "en_US",
    "username": "{username}",
    "social_connections": [],
    "_embedded": {
      "media:recent": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media/recent?auth_token={auth_token}&version={version}"
          }
        }
      }
    },
    "_forms": {
      "media:upload": {
        "title": "{title}",
        "action": {
          "href": "//photorankapi-a.akamaihd.net/users/{user_id}/media"
        },
        "method": "POST",
        "fields": [
          {
            "type": "text",
            "prompt": "Caption",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          },
          {
            "type": "text",
            "prompt": "URL",
            "name": "{name}",
            "value": "{value}",
            "placeholder": "{placeholder}"
          }
        ]
      }
    }
  }
}

HTTP Request

PUT /users/{user_id}

Parameters

user_id
<integer> (required) 

The id of the user to be updated.

screen_name
<string> (required) 

The full name of the user. Note that this is different from user handle. User handle will be derived from the local-part of the email address provided in the Create a User endpoint.

avatar_url
optional <string> (required) 

The avatar URL of the user. Avatar must be a valid image type jpg, gif, png and must be smaller than 5MB. If it is missing or avatar file does not fit the file type and size validations, then the a default image URL will be used.


Widget Endpoints

You can use the following endpoints to access widget instance & style information.

Widget Instances and Styles are created in the Olapic admin. For more information about widgets, please refer to our Getting Started with Widgets guide.

Get Widget Instance by ID

Get a widget instance object by its unique id.

GET /widgets/instance_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/widgets/{instance_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "_embedded": {
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": true,
          "column_number": "3",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": false,
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "disabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "widget2",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v2",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": true,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": false
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      },
      "setting": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/widgets/settings/{settings_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "type": "olapic_wallv2",
        "name": "{name}",
        "title": "{title}",
        "upload_button_text": "{upload_button_text}",
        "all_photos_text": "{all_photos_text}",
        "img_size": "mobile",
        "sorting": "packery",
        "page_limit": "20",
        "page_batch": "7",
        "external_batch": false,
        "scroll_element": 0,
        "call_to_action": "{call_to_action}",
        "thumbnail_size": "mobile",
        "streams_filter": "0",
        "streams_filter_show_all": "0",
        "streams_list": [],
        "streams_order": [],
        "categories_list": [],
        "categories_filter": false,
        "categories_order": [],
        "allow_views": false,
        "default_view": "grid",
        "sticky_menu": "0",
        "allow_gotop": "0",
        "items_get_categories": "0",
        "shop_this_look": "1",
        "views": "//photorank.me/assets/abe/widget2/olapic_wallv2/{olapic_wallv2_id}.html",
        "_analytics": {
          "oid": "{oid}",
          "t": "widget",
          "meta": [
            "user_agent",
            "event_type",
            "is_mobile"
          ]
        }
      }
    },
    "name": "{name}",
    "type": "best_photos",
    "settings": {
      "sorting": "recent",
      "mode": "development",
      "rights": "{rights}",
      "precache": false,
      "disable_base_styles": false,
      "uploader_id": "{uploader_id}",
      "enable_tagging": false
    }
  }
}

HTTP Request

GET /widgets/{instance_id}

Parameters

instance_id
<string> (required) 

The id of the widget instance to be returned.


Get Widget Instances of Customer

Get a list of widget instance objects related to a customer.

GET /customers/customer_id/widgets
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/widgets?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/widgets?page_key={page_key}&page_number={page_number}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "{href}"
      },
      "next": {
        "href": "{href}"
      }
    },
    "_embedded": {
      "widgetinstance": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/widgets/{instance_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "_embedded": {
            "customer": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": false
            },
            "setting": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/widgets/settings/{settings_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": false
            },
            "category": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/categories/{category_id}?auth_token={auth_token}&version={version}"
                }
              }
            }
          },
          "name": "{name}",
          "type": "by_category",
          "settings": {
            "sorting": "recent",
            "mode": "development",
            "rights": "{rights}",
            "precache": false,
            "disable_base_styles": false,
            "uploader_id": "{uploader_id}",
            "enable_tagging": false
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/widgets/{instance_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "_embedded": {
            "customer": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": false
            },
            "setting": {
              "_links": {
                "self": {
                  "href": "//photorankapi-a.akamaihd.net/widgets/settings/{settings_id}?auth_token={auth_token}&version={version}"
                }
              },
              "id": "{id}",
              "_fixed": false
            }
          },
          "name": "{name}",
          "type": "best_photos",
          "settings": {
            "sorting": "recent",
            "mode": "development",
            "rights": "{rights}",
            "precache": false,
            "disable_base_styles": false,
            "uploader_id": "{uploader_id}",
            "enable_tagging": false
          }
        }
      ],
      "customer": {
        "_links": {
          "self": {
            "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}?auth_token={auth_token}&version={version}"
          }
        },
        "id": "{id}",
        "_fixed": true,
        "name": "{name}",
        "domain": "{domain}",
        "template_dir": "{template_dir}",
        "language": "en_US",
        "settings": {
          "force_viewer_modal": true,
          "column_number": "3",
          "items_per_page": 10,
          "uploader_actions": "listSources,labeling,login,finish",
          "show_in_home": "bestphotos",
          "show_in_home_id": "0",
          "force_https": false,
          "ab_testing": 0,
          "olapicU": "enabled",
          "customer_dependant": {
            "viewer": "{viewer}",
            "widget": "widget2",
            "uploader": "{uploader}",
            "assets2": "default"
          },
          "analytics_cookie_domain": "{analytics_cookie_domain}",
          "premoderation": false,
          "tagging": false,
          "analytics_api_version": "v1",
          "analytics_checkout_file_prefix": "{analytics_checkout_file_prefix}",
          "analytics_dashboard_engagement": false,
          "analytics_conversion_interval": "30-minutes",
          "currency": "$",
          "analytics_enterprise_analytics": true
        },
        "views": {
          "viewer": "{viewer}",
          "uploader": "{uploader}"
        },
        "_embedded": {
          "user": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/users/{user_id}?auth_token={auth_token}&version={version}"
              }
            },
            "id": "{id}",
            "_fixed": false
          },
          "media": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:recent": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/recent?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:shuffled": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/shuffled?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:photorank": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/photorank?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          },
          "media:rated": {
            "_links": {
              "self": {
                "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/media/rated?auth_token={auth_token}&version={version}"
              }
            },
            "_fixed": false
          }
        },
        "_forms": {
          "streams:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/streams/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Product ID",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "categories:search": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/categories/search"
            },
            "method": "GET",
            "fields": [
              {
                "type": "text",
                "prompt": "Tag",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "stashes:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/stashes"
            },
            "method": "POST",
            "fields": [
              {
                "type": "file",
                "prompt": "File",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          },
          "users:create": {
            "title": "{title}",
            "action": {
              "href": "//photorankapi-a.akamaihd.net/users"
            },
            "method": "POST",
            "fields": [
              {
                "type": "text",
                "prompt": "Email",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Screen name",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              },
              {
                "type": "text",
                "prompt": "Avatar URL",
                "name": "{name}",
                "value": "{value}",
                "placeholder": "{placeholder}"
              }
            ]
          }
        }
      }
    }
  }
}

HTTP Request

GET /customers/{customer_id}/widgets

Parameters

customer_id
<integer> (required) 

The id of the customer.


Get Widget Style by ID

Get a widget style object by its unique id.

GET /widgets/settings/style_id
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.0"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/widgets/settings/{style_id}?auth_token={auth_token}&version={version}"
      }
    },
    "id": "{id}",
    "_fixed": true,
    "type": "olapic_slidev3",
    "name": "{name}",
    "help_link": true,
    "stream_link": "1",
    "stream_link_custom": "{stream_link_custom}",
    "img_size": "mobile",
    "photos_limit": "20",
    "slide_mode": "1",
    "slide_by": "1",
    "minInfinite": 0,
    "infinite": "0",
    "auto_play": "0",
    "interval": 0,
    "duration": 3000,
    "js_animation": "0",
    "views": "//photorank.me/assets/tuckernuck/widget2/olapic_slidev3/{olapic_slidev3_id}.html",
    "_analytics": {
      "oid": "{oid}",
      "t": "widget",
      "meta": [
        "user_agent",
        "event_type",
        "is_mobile"
      ]
    }
  }
}

HTTP Request

GET /widgets/settings/{style_id}

Parameters

style_id
<string> (required) 

The id of the widget style to be returned.


Get Widget Styles of Customer

Get a list of widget style objects related to a customer.

GET /customers/customer_id/widgets/settings
Responses200
Headers
Content-Type: application/json
Response
{
  "metadata": {
    "code": 200,
    "message": "OK",
    "version": "v2.2"
  },
  "data": {
    "_links": {
      "self": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/widgets/settings?count={count}&auth_token={auth_token}&version={version}"
      },
      "first": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/widgets/settings?count={count}&auth_token={auth_token}&version={version}"
      },
      "prev": {
        "href": "//photorankapi-a.akamaihd.net/customers/{customer_id}/widgets/settings?prev_id={prev_id}&count={count}&auth_token={auth_token}&version={version}"
      }
    },
    "_embedded": {
      "widget": [
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/widgets/settings/{style_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "olapic_slidev3",
          "name": "{name}",
          "help_link": true,
          "stream_link": "4",
          "stream_link_custom": "{stream_link_custom}",
          "img_size": "mobile",
          "photos_limit": "20",
          "slide_mode": "1",
          "slide_by": "1",
          "minInfinite": "{minInfinite}",
          "infinite": "1",
          "auto_play": "0",
          "interval": 0,
          "duration": 3000,
          "js_animation": "0",
          "views": "//photorankstatics-a.akamaihd.net/assets/backendtest/widget2/olapic_slidev3/{olapic_slidev3_id}.html",
          "_analytics": {
            "oid": "{oid}",
            "t": "widget",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        },
        {
          "_links": {
            "self": {
              "href": "//photorankapi-a.akamaihd.net/widgets/settings/{style_id}?auth_token={auth_token}&version={version}"
            }
          },
          "id": "{id}",
          "_fixed": true,
          "type": "buttonv2",
          "name": "{name}",
          "help_link": true,
          "call_to_action": "some_action",
          "views": "//photorankstatics-a.akamaihd.net/assets/backendtest/widget2/buttonv2/{buttonv2_id}.html",
          "_analytics": {
            "oid": "{oid}",
            "t": "widget",
            "meta": [
              "user_agent",
              "event_type",
              "is_mobile"
            ]
          }
        }
      ]
    }
  }
}

HTTP Request

GET /customers/{customer_id}/widgets/settings

Parameters

customer_id
<integer> (required) 

The id of the customer.


Last Updated: 08 Nov 2019