The Searchspring Bulk Indexing API allows you to request a Searchspring bulk index of your feed. This process will download your feed, process it and index your updated product data into our search databases. There is also a status endpoint to get the status of your index.
Bulk Index Endpoint
URL
https://[siteId]:[secretKey]@index-api.searchspring.net/api/index/feed
Request Method
This endpoint accepts both PUT and POST requests.
The PUT version of this endpoint will download your product data from your cart or server and trigger an index of that data. This is endpoint should be used if you are using one of our cart integrations (Shopify, BigCommerce, etc).
The POST version of this endpoint accepts a feed file, uploads it to our server and triggers an index of that feed. You should only use this endpoint in the case that you are using a custom CSV or XML file. If you wish to use this endpoint, the [Searchspring Support team] (https://help.searchspring.net/hc/en-us) will need to update your feed URL to point to the location where your feed will be uploaded on our servers.
Both of these versions will only accept a re-index once per hour.
Protocol
In order to protect your authentication credentials, this request must be made over HTTPS.
Content-Type
The request parameters require that the Content-Type header is sent as "multi-part/form-data" in order to send the feed file.
Request Authentication
This endpoint uses standard HTTP authentication. The username is the Site ID of your account. The password is the secret key of your account. You can contact [Searchspring support](https://help.searchspring.net/hc/en-us) for these if needed.
Request Parameters
Feed ID (Required): Identifies the feed to index.
- Format: feedId=[value]
- Example: feedId=65
Feed File: The path of the feed file to upload. The maximum size of this file is 20MB. It is recommended that you compress your feed using zip or gzip compression to reduce file size. Only used in the POST version of this endpoint.
- Format: feedFile=@[filename.zip]
- Example: feedFile=@/path/to/my/feed.zip
Requested By: The email address to send the status email once indexing completes. This is currently only supported on the POST version of this endpoint.
- Format: requestedBy=[email@address.com]
- Example: requestedBy=james%40searchspring.com
Post Request Example
curl -v -XPOST -u foobar:abc123def456ghi789 -F feedFile=@/path/to/feed_file.zip "https://index-api.searchspring.net/api/index/feed?feedId=42&requestedBy=myemail%40searchspring.com"
Put Request Example (request parameters must be in the query string for put requests)
curl -v -XPUT -u foobar:abc123def456ghi789 https://index-api.searchspring.net/api/index/feed?feedId=42
Response Format
The response returned is a JSON-encoded object with the following attributes:
- success: Returns true if the feed was successfully added to the indexing queue or false if an error was encountered. A feed may still fail while indexing when success is returned, this endpoint merely returns whether or not the feed was added to the indexing queue successfully. To determine the success of the index you may use the status endpoint.
Response Example
{"success":true}
Status Endpoint
URL
https://[siteId]:[secretKey]@index-api.searchspring.net/api/index/status
Request Method
This endpoint accepts only GET requests.
Protocol
In order to protect your authentication credentials, this request must be made over HTTPS.
Request Authentication
This endpoint uses standard HTTP authentication. The username is the Site ID of your account. The password is the secret key of your account. You can contact Searchspring support at support@searchspring.com for these if needed.
Request Parameters
There are no request parameters for this request. It will determine your account information based on your authentication above.
Request Example
curl -v -XGET -u foobar:abc123def456ghi789 "https://index-api.searchspring.net/api/index/status"
Response Format
The response returned is a JSON-encoded object with the following attributes.
- status: The status of the request to fetch the status of your index. This will either be success or error.
- feeds: An array of objects representing the feeds associated with your account.
- feeds.id: The ID Of the current feed object.
- feeds.lastIndexed: The time your last index finished successfully.
- feeds.nextIndexTime: The next scheduled time your index will run automatically. This is incremented by your index interval once your index finishes.
- feeds.indexStatus: A textual description of the status of indexing. Possible values include:
- waiting: The index is waiting to run in our queue.
- running: The index is currently running.
- done: The index is finished.
- error: The last index did not finish due to an error.
- regen_waiting: The index is waiting for an external feed regeneration to start.
- regen_running: The external feed regeneration is running.
- regen_done: The external feed regeneration is done.
- regen_error: An error was encountered during the external feed regeneration.
Response Example
{ "status": "success", "feeds": [{ "id": 1143, "lastIndexed": "2017-05-30T13:50:25+0000", "nextIndexTime": "2017-05-30T16:03:42+0000", "indexStatus": "done" }] }
Comments
0 comments
Article is closed for comments.