Get Next Product to Pull
The Get Next Product to Pull operation retrieves products individually from Talk2Sync for insertion or update in the external system.
Before requesting the next product, the daemon must check whether Talk2Sync has finished processing the previous transaction. This is controlled through the hasmore status.
1. Check Whether More Products Are Available
First, query the product pull status:
GET https://api.talk2sync.com/api/adapters/custom/reverse/connection/{{your key}}/pull/products/hasmore
The endpoint returns a status similar to:
{
"hasmore": "waiting"
}
or:
{
"hasmore": "ready"
}
waiting
The waiting state indicates that the server is still processing the previous transaction.
The daemon must wait and query the endpoint again until the status changes to ready.
ready
The ready state indicates that the daemon can request the next product.
2. Retrieve the Next Product
Once the hasmore status is ready, request the next product:
GET https://api.talk2sync.com/api/adapters/custom/reverse/connection/{{your key}}/pull/products/next
The response contains the product that must be inserted or updated in the external system:
{
"product": {
"_id": "100004777",
"sku": "100004777",
"last_updated": 1517360038797,
"title": "EON618S JBL SUBWOOFER 18\" AMPLIFICADO",
"url": "",
"brand": "",
"mpn": "",
"model": "",
"description": "JBL Premium Transducers",
"variations": [
{
"availabilities": [
{
"tag": "default",
"quantity": "50"
}
],
"prices": [
{
"tag": "default",
"currency": "USD",
"number": "1060.51"
}
],
"images": [
{
"url": "https://www.example.com/13080-thickbox_default/eon618s-jbl-subwoofer-18-amplificado-.jpg"
}
],
"videos": [
{
"url": ""
}
],
"barcode": "",
"size": "",
"color": ""
}
]
}
}
The daemon can then process the returned product and report whether the storage operation succeeded or failed.
Process
Next Steps
- Review Notify Product Success to report a successful product storage operation.
- Review Notify Product Failure to report a failed product storage operation.
- Review Pull Products Page for the initialization process.
- Review Set Finish Product Pulls to finalize product downloads.