UGC Techdocs
  • Introduction
  • Guides
    • Analytics
      • Tracking UGC on Adobe Analytics
      • Tracking Widget interactions with Google Analytics
    • Direct Uploader
      • How to add Custom Data to Direct Uploader
      • How to capture Custom Data on Direct Uploader
      • How to automatically tag data on Direct Uploader
      • How to Customize error messages on Direct Uploader
      • How to Track Direct Uploader form submissions with Google Analytics (Universal & GA 4)
    • Data Templates
      • Creating a Data Template
    • Rights via Registration
      • Capture Custom Data on Rights by Registration Form
      • Styling Rights via Registration Form
    • REST API
      • Caching REST API results for optimization
      • Posting content into Nosto via Tile API
      • Posting images into Nosto via Tile API
    • Onsite Widgets (2.0)
      • Blank Canvas
        • How to Use the Blank Canvas to Create a Twitter Count Widget
        • Creating an Auto-Scrolling Carousel using Blank Canvas
        • Creating Gallery Widget by Using the Blank Canvas Widget
        • Creating a simple Hover effect using Blank Canvas
        • Creating a Word Cloud using Blank Canvas
        • Creating Your Widget by Using the Blank Canvas
      • Bind your own Events
      • Creating a Grid Widget from Waterfall
      • Create a Q&A Widget using Data Templates
      • Displaying a Widget in a Mobile App
      • Dynamically Specify Products to Display in Widget
      • Dynamically specify what Tile to display in a Widget
      • How to add a title / subtitle to a widget
      • How to localize the load more button on widgets
      • How to overlay existing Google Map with the UGC Map Widget
      • How to use Filter and search in a Widget
      • How to change click on inline tile behaviour to redirect to PDP in a Widget
      • Styling cross-sellers on Grid and Carousel Widgets
      • How to Load External JS and CSS into Widgets
      • Profiling Widget Performance
      • Re-targeting with Widgets and Facebook Pixel
      • Render Widget filters dynamically
      • Styling Carousel Widget
      • Styling Grid Widget
      • Styling Masonry Widget
      • Styling Waterfall Widget
      • Styling Widget Expanded Tile
      • Styling Widget Shopspots
      • Using Web Fonts in Widgets
    • Digital Screens
      • Customizing Carousel Event Screen
      • Customizing Mosaic Event Screen
      • Customizing Scrollwall Event Screen
      • Customizing the Mosaic Event Screen to Have 9 Even Tiles
    • Email
      • Adding Location to an Email Tile
      • Styling the Email Widget
    • Integrations
      • DoubleClick
        • UGC Ads with Nosto and Google DoubleClick
      • Zapier
        • Consuming UGC Webhooks via Zapier
      • Mailchimp
        • Bring Social Content into a Mailchimp Campaign
    • Webhooks
      • Trigger notifications when content is in the moderation queue
  • Widgets
  • API Docs
    • JavaScript API
      • Widgets
        • Introduction
        • API Reference for Content Widgets
        • API Reference for Blank Canvas
        • API Reference for Map Widget
      • Digital Screens
        • Introduction
        • API Reference
    • Content API
      • Reference
    • REST API
      • Reference
        • Filters API
        • Moderation Views API
        • Tags API
        • Terms API
        • Tiles API
        • Users API
        • Widgets API
        • Automation Rules API
        • REST API Reference Widgets style and config
      • Best Practices
    • Webhooks
  • Enterprise Tools
    • Automation Rules
      • Triggers
      • Actions
      • Samples
    • Data Templates
    • User Access Control (UAC)
    • Single Sign On (SSO)
    • Enterprise Admin User Interface (EAUI)
    • Zapier
  • Commerce Tools
    • Product Feeds
    • Widget Implementation
    • Reporting
    • Integrations
      • Google Tag Manager
      • Magento
      • SalesForce Commerce Cloud
      • Shopify
      • Shopify Add To Cart
        • Global Variant Mapping for Add to Cart
        • Customise Add to Cart Widget Experience
  • Analytics
    • Google Analytics 4
      • Getting Started
      • Widgets Events
      • E-commerce Events
      • Email Events
  • Terms of Use
Powered by GitBook
On this page
  • Finding your plugin's Unique identifier (Plugin ID)
  • Content filters
  • Security
  • Access control
  • Allowed domains
  • Example Requests
  • Content Type
  • Available request parameters
  • Error handling
  • Basic Requests
  • Complex Requests

Was this helpful?

  1. API Docs
  2. Content API

Reference

Finding your plugin's Unique identifier (Plugin ID)

The identifier {Plugin ID}and API Endpoint are generated when the Content API is configured in the Nosto Admin Portal.

  1. Login to the Nosto Admin Portal > UGC.

  2. On the sidebar, click Tools > Content API.

Content filters

By default, the Content API can be configured to output content from a specific filter. This is configured within the admin portal.

To output content from all filters, you can set the configured filter to latest (assuming this filter hasn't been customized). In this configuration, the Content API can access any content within a Stack and, using tags, can target specific items or groups of items.

Dynamically setting the override filter to the ID of the latest filter when the tags parameter is used is a helpful method to ensure any content with those tags is returned, not just the content from the configured filter.

Your Stack's filter IDs can be found on the filter's page in your Nosto Admin Portal. Click Curate > Filters on the side navigation bar.

Security

Access control

Each Content API has a unique identifier, making each URL private by default.

Nosto's UGC Content API is designed to be open to access and does not implement any access control mechanisms. Sharing the private URL, making it publicly known, or using it within Javascript on a website will allow all the below requests to be made by anybody. Keep this in mind when designing integrations with this plugin.

NOTE: To generate a new unique identifier, the plugin will have to be reinstalled from within the Nosto admin portal.

Allowed domains

When making requests to the API in a browser via AJAX, a pre-flight HTTP OPTIONS request will be made to validate the Cross-Origin Resource Sharing (CORS) policy.

By default, the Access-Control-Allow-Origin response will allow all domains. e.g. *

A comma-separated list of allowed domains can be configured in the plugin configuration page. Adding domains to this list will change the API's response to any pre-flight HTTP OPTIONS requests made by the browser to contain only the domain(s) specified.

NOTE: This does not restrict access to the Content API, or its output. It simply limits its usage from within unauthorized websites using modern browsers' built-in protections.

Example Requests

The following example requests illustrate some common use cases of the Content API, using the available request parameters.

Content Type

The Content API outputs data in the JSON format. Valid responses containing JSON will always include the HTTP header Content-Type: application/json. This should be used to validate the output of the Content API in case of an unexpected error (see below).

Available request parameters

Name
Expected Value

limit

Integer

page

Integer

filter_id

Integer

tags

Comma separated string of tag IDs

brands

Comma separated string of brands

categories

Comma separated string of categories

Error handling

The Content API is designed to be robust as possible. It does not follow the REST API pattern or utilise HTTP error code conventions to communicate the state of the response.

The following rules are used to handle issues;

Invalid parameter names or values types will be ignored

  • The request will continue to process.

  • No 400 codes or error messages will be returned on invalid requests.

Valid parameter types with values outside the expected range will default to their _minimum_** values**

  • See expected ranges below.

There is no fallback/default content for filters or tags requests which return empty results

Some requests will still return HTTP errors

  • Requests using invalid plugin IDs will return a 404 page.

  • Service errors will still return 5xx errors.

  • Requests flagged as security violations may return 4xx errors.

Basic Requests

  • Configured filter can default to query all content, using thelatest filter ID.

  • Response data is always cached for 3 minutes based on query structure.

  • Limit range: 1-50 items.

  • Page range: 1-999 pages.

Default request

Return 50 items from the default filter configured in the admin portal.

https://plugins.stackla.com/content_api/{Plugin ID}

Limits & Pages

Return 10 items from configured filter.

https://plugins.stackla.com/content_api/{Plugin ID}?limit=10

Return 3 items from the second page (items 4, 5 & 6) from configured filter.

https://plugins.stackla.com/content_api/{Plugin ID}?limit=3&page=2

Complex Requests

  • Configured filter can default to query all content, using thelatest filter ID.

  • Response data is always cached for 6 minutes based on query structure.

  • Item range: 1-100 items.

  • Page range: 1-999 pages.

  • Tag limit: 0-20 tag IDs.

  • Filter limit: 0-1 filter IDs.

Limits & Pages

Return 100 items from configured filter.

https://plugins.stackla.com/content_api/{Plugin ID}?limit=100

Return 100 items from configured filter, starting at page 3 (items 300-400).

https://plugins.stackla.com/content_api/{Plugin ID}?limit=100&page=3

Override Default Filter with Custom Filter

Return 50 items from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123

Return 75 items from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123&limit=75

Override Default Filter with Custom Filter and tags

Return 50 items matching tags 123, 456 and 678 from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123&tags=123,456,678

Return 10 items from the 10th page, matching tags 123, 456 and 678 from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123&limit=10&page=10&tags=123,456,678

Override Default Filter with Custom Filter and brands

Return 50 items matching brands nike from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123&brands=nike

Override Default Filter with Custom Filter and categories

Return 50 items matching categories shoes from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123&categories=shoes

External Product tags

Note: External tags must use the ext: prefix to differentiate them from internal tag IDs. External tag IDs can be strings.

Return 30 items matching product tags using external ID abc123 from configured filter.

https://plugins.stackla.com/content_api/{Plugin ID}?limit=30&tags=ext:abc123

Return 50 items matching product tags using external ID abc123 and xyz987 from filter 123.

https://plugins.stackla.com/content_api/{Plugin ID}?filter_id=123&tags=ext:abc123,ext:xyz987

PreviousContent APINextREST API

Was this helpful?

Read more about CORS .

here