Calling the Incremental Feed API
You can use either the HTTP or the HTTPS protocol to make calls to the Incremental Feed API.
You use the POST method to call the Incremental Feed API.
For data security and privacy reason, we recommend that you use the HTTPS protocol to make calls to the Discover APIs.
Sitecore Discover APIs accept requests payload in the form of JSON objects or a URL encoded JSON string.
Incremental Feed API end-point
You can obtain the API URL in the Customer Engagement Console (CEC), in Developer Resources, on the API Access tab, as shown in the following example:
Recommendations for optimal API calls performance
Each call to the Incremental Feed API results in multiple operations in Discover. Requests with large payloads also take longer to travel through the network. For an optimal performance, Sitecore recommends to include a maximum of 10 stock keeping units (SKUs) per call to the API endpoint.
During onboarding, a Sitecore integration specialist works with you to determine and configure the adequate throttle limit for your implementation. You can see throttle limits configured for each Discover service in the CEC, in Developer Resources, on the API Access tab.
Authentication
If you use a subdomain in your Discover implementation, you are not required to authenticate requests to the Discover API. You can call the API endpoint directly.
Otherwise, if do not use a subdomain, Sitecore recommends that you authenticate your request.
The following shows an example of an API request header including an API key.
Host: Header: Header: |
Do not call the Incremental Feed API from within the browser. Calling the API from within a browser exposes how you are modifying data in real time and constitute a security risk.
Keys in an Incremental Feed API request
The following table lists the keys in the payload of an Incremental Feed API request:
Key |
Data type |
Description |
---|---|---|
|
string |
Required. An API key provided by Sitecore during Discover onboarding. You use this key to make API calls from the server. |
|
string |
Required. A JSON string that represents the data object included in the request. |
Example of a POST request to the Incremental Feed API
The following shows an example of a POST request to the Incremental Feed API:
POST <INC_API_URL>/feed/products/incremental/update
{
"data": "{<your_key_value_data>}"
}
Header:
Content-Type: application/json
Authorization: "<your api-key>"
OR
Authorization: "Bearer <your access-token>"
Example request to the Incremental Feed API using Curl
You can use the Curl programming language to make calls to the Incremental Feed API. The following shows an example of what every Curl calls to the API must include:
curl -X POST \
<INC_API_URL>/feed/products/incremental/update \
-H 'Accept: */*' \
-H 'Accept-Encoding: gzip, deflate' \
-H 'Authorization: 01-16d038d8-1f12d3e2b2...9b05467c7011af308' \
-H 'Content-Type: application/json' \
-d '<data-object>'