Indexer API
Seamlessly Index, Update, and Optimize Your Catalog for Peak Performance
Utilize our Indexer APIs to effortlessly upload and manage your product feed. We offer support for two types of feed uploads:
- Full Feed Upload: This method is ideal for uploading your entire product catalog or overwriting any existing copy on our servers. Periodic full feed uploads are recommended to maintain synchronization between your catalog and production systems.
For initial catalog uploads, we recommend utilizing the Full Feed Upload API to ensure a seamless on-boarding experience.
- Delta Feed Upload: Also referred to as Incremental Feed Upload, this method allows you to efficiently update or add multiple records. Use it for partial catalog uploads, ensuring seamless integration of new data into your catalog.
Our Indexer API supports various event types, each designed for specific data management operations:
- CREATE:
- Description: Import the entire dataset into the database.
- Operation: This triggers a create operation in the database, ensuring the complete dataset is indexed.
- PARTIAL UPDATE:
- Description: Update or insert specific fields in the documents.
- Operation: This initiates an update operation in the database, allowing for targeted modification or addition of fields within the documents.
- REPLACE:
- Description: Replace or create documents.
- Operation: This performs an upsert operation (replace or index) in the database, either replacing existing documents or creating new ones.
- DELETE:
- Description: Delete documents.
- Operation: This triggers a delete operation in the database, removing specified documents from the index.
Indexing
The Indexer API empowers you to seamlessly create indexing tasks and monitor their status. All routes within the Indexer API require authentication using an HTTP Bearer token.
Authentication
Ensure that you include an HTTP Bearer token in the headers of each request to authenticate. For more details please check Service Accounts.
Publish
- Batch Publish
This route allows you to send multiple documents for indexing with the same event type.
Endpoint
POST: /batch/publish
Sample Request
curl -X 'POST' \
'https://api.topiq.ai/indexer-api/batch/publish' \
-H 'accept: application/json' \
-H 'Authorization: {{api_key}}
-d '{
"app_id": "string,
"payload": [
{}
],
"event_type": "CREATE"
}'
Request Body
{
"event_type": "string",
"app_id": "string",
"payload": [
{}
]
}
event_type: Specifies the type of indexing operation.
app_id: Identifies the application for which the indexing should occur.
payload: Array of documents to be indexed.
Each doc of the payload should contain the unique identifier (primary key) of the product.
Error Codes
Response codes to indicate success or failure of an API request.
200 (Ok): Indicates the upload was successful.
401 (Authorization Error): Indicates you may have provided an invalid API key.
400 (Bad Request): Indicates you may have missed a required parameter.
500 (Internal Server Error): Though these are rare, this indicates we may have messed up.
Response Body
{
"success": true,
"task_id": "string"
}
task_id: Unique identifier generated for each indexing event, which can be used to check the index status the task
Status
The Status API within our Indexer provides real-time insights into the progress and completion status of indexing tasks. When you initiate an indexing task, a unique task ID is assigned to it. The Status API allows you to query the system, providing the task ID, and retrieve detailed information about the task's status.
Endpoint
POST: /batch/status
Sample Request
curl -X 'POST' \
'https://api.topiq.ai/indexer-api/batch/status?app_id={{app_id}}' \
-H 'accept: application/json' \
-H 'Authorization: {{api_key}}
-H 'Content-Type: application/json' \
-d '[
{{task_id}},
..
]'
Response
Upon making a request to the Status API, you will receive a detailed response providing crucial information about the specified indexing task. The response includes:
task_id: The unique identifier of the task.
status: The current status of the task, which can be one of the following:
- "Created": The task has been created but not yet started.
- "Completed": The task has been successfully completed.
- "Validation Failed": The task encountered validation errors during processing.
- "Partially Failed": Some parts of the task failed while others succeeded.
- "Failed": The entire task failed.
created_date: The timestamp indicating when the task was initially created.
updated_date: The timestamp indicating the last update or modification to the task status.
Things to consider
- In cases where the specified task ID is not found, the API will respond with "Task Not Found." It's important to handle this response accordingly in your implementation.
- When a batch task is failed, the whole batch has to be resent again.
Updated 10 months ago