Notify Product Storage Failure
When the daemon cannot insert or update a product successfully, it must notify Talk2Sync of the failure and provide enough information to identify the problem.
This notification allows Talk2Sync to register the failed product transaction and continue managing the synchronization process.
1. Notify the Storage Failure
Send a POST request using the _id of the product that could not be processed:
POST https://api.talk2sync.com/api/adapters/custom/reverse/connection/{{your key}}/pull/products/{{_id}}/failed
Replace {{_id}} with the identifier of the affected product.
2. Request Body
The request body must contain the error description and the reasons for the failure:
{
"error": "could not pull product",
"reasons": [
{
"message": "custom error string message",
"code": 400
}
]
}
The error field provides a general description of the failure, while reasons contains the specific error details.
Each reason includes:
message— Describes the specific problem encountered by the daemon.code— Application-specific error code associated with the problem.
3. Wait for the Transaction to Complete
The failure notification should return HTTP 200 OK.
After receiving a successful response, the daemon must wait until Talk2Sync finishes processing the product transaction before requesting another product.
Check the product readyfornext status:
GET https://api.talk2sync.com/api/adapters/custom/reverse/connection/{{your key}}/pull/products/readyfornext
The response should have a structure similar to:
{
"ready": false
}
or:
{
"ready": true
}
ready: false
Talk2Sync is still processing the failed transaction. The daemon must wait and query the endpoint again.
ready: true
The transaction has completed and the daemon can proceed with the next product.
Process
Next Steps
- Review Get Next Product to Pull to retrieve the next product.
- Review Notify Product Storage Success for successful storage operations.
- Review Set Finish Product Pulls to finalize the product pull process.