Integration with Salsify 

Overview

Salsify provides access to portions of our API to customers that wish to do an integration.

In general, there are three primary ways to get product data out of Salsify programmatically:

  • Using the Product CRUD API
  • Creating a “channel” and making a GET request to retrieve the latest product feed
  • Utilizing Product webhooks to receive product data as they change

Your use case will dictate which approach your team takes. The Product CRUD API is useful for 1-off requests and changes, while retrieving a product feed from a channel is useful for mass exports or changes, and webhooks can provide you with real-time capabilities if that is important.

Authentication

There are two ways to authenticate with the Salsify API.

  • HTTP Authorization header or pass authentication token via an access_token query parameter. Click here for more information.
  • Authentication via OAuth 2.0: Example code on how to OAuth can be found here.

OAuth 2.0

Salsify utilizes OAuth 2.0, which allows the client to login to their Salsify account via a browser popup window.  The advantage to using OAuth is that there is no need to store user credentials in the system.

Here is some general information on OAuth, keeping in mind that we recommend implementing the authorization code grant type:

http://docs.apigee.com/api-services/content/oauth-introduction

Click here for details on authenticating with Salsify via OAuth 2.0.

Using Channels To Export Product Data

Getting product information out of Salsify is straightforward. The general concept is as follows.

  1.  Configure a “channel” to export your selected products and their attributes in JSON format.   
  2. Make a GET to that latest channel’s export run to receive the JSON file (which is hosted on S3)

GET Export Run Tutorial

Step 1: Set Up a Channel to Export your JSON

  1. Set up a Channel in Salsify - your source of product information.  Configure the Channel
    • Click Product Selection and choose your products
    • Go back and click Product Feed
    • Set Format to JSON
    • Choose the columns you want to export (these are the product attributes you have in Salsify)
    • Go back and click Publication Schedule - you can configure this channel to be published every night so that you are dealing with up to date information
  2. Retrieve the channel id
    •     This will be used to target the channel for future requests and can be found at the end of the URL when you click into the channel
    •     Example: https://app.salsify.com/app/channels/123456

Step 2: GET Latest Product Feed

With the channel id, you can send a GET request with your authorization to:
https://app.salsify.com/api/channels/<channel_id>/runs/latest

cURL Example:
curl https://app.salsify.com/api/channels/<insert_channel_id>/runs/latest -H  "Authorization: Bearer <your auth token here>"

Example response found here

You can parse the JSON response and use the JSON URL from the product_export_url key.

The JSON you get from this URL is the entire product feed from the channel. This is a temporarily available S3 file that you can now open to read the product data. It contains all of the information about the products you selected in the channel, as well as the properties that you chose to include in the export in the configuration.

Example JSON of the product export found here

You can see the JSON comes in several sections: attributes and products. If you chose to include digital asset properties in your product export, you can also find the URLs to those digital assets next to every product.

Using Product CRUD API

More information can be found on our help site, here

Using Salsify Webhooks

Salsify Webhooks can be used to receive product information based on several types events that happen within Salsify.

  • New products as added to Salsify
  • Any property on a product has changed
  • A selected property has changed

Implementation

  1. Select the group of products you want to monitor and set up a notification.  You can learn more about subscribing to notifications here.
  2. Contact your Customer Champion or our customer success team at success@salsify.com, and provide a URL to receive the webhook from Salsify.