Skip to content

Instantly share code, notes, and snippets.

@joshchu
joshchu / gist:680568cfacc2db479816
Last active August 29, 2015 14:00
templated excel functions
# Extract value for property
#
# params:
# external_id - target property external_id
# index - index to take for multivalued properties
# default is 1.
#
# Sample:
# Product: sku => 020009, color => [Red, Blue]
# SALSIFY_VALUE("sku") => 0200009
@joshchu
joshchu / gist:eb2045094ea63fd50ad0
Created April 30, 2014 18:46
channel webhook run - failure
{
"channel_name":"My Channel Run - Failure",
"publication_status":"failed",
"product_feed_export_status":"failed",
"digital_asset_export_status":"failed",
"feed_delivery_status":"failed"
}
@joshchu
joshchu / gist:cc00c8483ab1b53a5e4f
Created April 30, 2014 18:41
channel run webhook - success
{
"channel_name":"My Channel Run - Success",
"publication_status":"completed",
"product_feed_export_url":"http://output.at.salsify.com/to/your/product/feed",
"digital_asset_export_url":"http://output.at.salsify.com/to/your/digital/asset/feed",
}
@joshchu
joshchu / gist:9966353
Created April 4, 2014 01:37
ruby example
require 'rest_client'
# Create the product
product = {'SKU' => '12345', 'Name' => 'Big TV', 'Brand' => 'Salsify'}
RestClient.post('http://localhost:5000/api/v1/products/', product.to_json,
accept: 'application/json', content_type: 'application/json',
'X-AUTH-TOKEN' => 'ABC123', 'X-USER-EMAIL' => 'joe@customer.com')
# Update the product
product = {'Inventory' => '10'}
{
"Inventory": null
}
{
"SKU": "3635065-UPDATED"
}
{
"Inventory": "10"
}
{
"SKU": "3635065",
"Model": "KDL-40NX700",
"Name": "Sony 40 in. Bravia TV",
"Description": "This is an amazing tv. You should buy it.",
"Brand": "Sony",
"Aspect Ratio": "16:9",
"Feature": ["Child Lock", "Picture in Picture", "Sleep Timer"],
"Release Date": "10-19-2013",
"Inventory": "10"
@joshchu
joshchu / gist:9960383
Last active August 29, 2015 13:58
multi-file import
[
{ "header": { } },
{ "attributes": "attributes.json" },
{ "attribute_values": "attribute_values.json" },
{ "products": "products.json" }
]
@joshchu
joshchu / gist:9960292
Last active August 29, 2015 13:58
header
{
"header": {
"version": "2013-04",
"scope": ["all"],
"mode": "truncate"
}
}