/clicks
This method returns a list of daily metrics by product.
https://api.shopstylecollective.com/api/v3/partners/YOUR_API_KEY/reports/clicks?start=2017-10-01&end=2017-11-30pid=YOUR_API_KEY
start: a start date for the reports generated, e.g. 2017-10-01
end: an end date for the reports generated, e.g. 2017-11-30
RESPONSE
A list of daily metrics by product.
API AUTHENTICATION
This API requires an authentication header to secure the data returned. The authentication header is made of two components: the authorization token and authorization date.
- 1. From ShopStyle Support, request a secret key that will be used to generate the authorization token.
- 2. Identify your numeric user id. Your numeric user id can be found in your API Key. This is a string that is assigned to the caller. You can find your API Key on the Account Settings page. The API key is in the format uidXXXX-XXXXXXXX-XX. The center numeric portion between the dashes is your numeric user id. For example, if your API Key is uid1234-56789012-34, then 56789012 will be your numeric user id.
- 3. Generate a timestamp in the format "EEE, dd MMM yyyy HH:mm:ss z" (RFC 1123) and GMT timezone using the current time. Example:
Wed, 28 Apr 2010 08:30:10 GMT
- 4. Add the timestamp to the request header
Authorization-Date: EEE, dd MMM yyyy HH:mm:ss z
- 5. Create a SHA1 hash of your Secret Key, API Key, Numeric User ID, and the Timestamp to generate the authorization token. Base64 encode the resulting hash.
For an example, see the ShopStyle Java API Client - 6. Concatenate your numeric user id with the authorization token using a ':' and add it to the request header
Authorization: SHPST 56789012:<token>
EXAMPLE API REQUEST
- 1. Start with the base url of the request.
https://api.shopstylecollective.com/api/v3/partners/YOUR_API_KEY/reports/clicks
- 2. Add your API KEY to the request. A unique API_KEY string that is assigned to the caller. You can find your API Key on the Account Settings page. Replace 'YOUR_API_KEY' with the actual value found on that page. Also, append it to the url with ?pid=YOUR_API_KEY.
https://api.shopstylecollective.com/api/v3/partners/uidXXXX-XXXXXXXX-XX/reports/clicks?pid=uidXXXX-XXXXXXXX-XX
- 3. Add a start date and end date range. The date range format is YYYY-MM-DD. Append the values to the url with &start=YYYY-MM-DD and &end=YYYY-MM-DD. The end date must be on or after the start date.
https://api.shopstylecollective.com/api/v3/partners/uidXXXX-XXXXXXXX-XX/reports/clicks?pid=uidXXXX-XXXXXXXX-XX&start=2018-04-01&end=2018-05-01
SAMPLE JSON RESPONSE
[{ "clickDate": "2017-10-04", "link": "https://shop.nordstrom.com/S/3466405", "retailerName": "Nordstrom", "productName": "Chuck Taylor(R) 'Shoreline' Sneaker", "brandName": "Converse", "categoryName": "women sneakers", "earningsAmount": 0.6, "orders": 0, "clicks": 6 }, { "clickDate": "2017-11-23", "link": "http://www.lordandtaylor.com/main/ProductDetail.jsp?PRODUCT%3C%3Eprd_id=845524442407349", "retailerName": "Lord & Taylor", "productName": "Faith & Zoe Bell Graphic Sweater", "brandName": null, "categoryName": "women sweaters", "earningsAmount": 3.8, "orders": 0, "clicks": 38 }]