Product
Best practise
How to successfully harvest data using this endpoint:
- Fetch locally stored lastReplicationTimestamp if applicaple
- Call max endpoint and store MaxTimestamp.
- Call updates endpoint with parameters:
from = lastReplicationTimestamp
,to = MaxTimestamp
(andlastoffsetid = nextoffsetid
from previous batch) - Call softdeletes endpoint with the same parameters as above. Before deleting locally, ensure that the deleted entity has the highest timestamp
- Call harddeletes endpoint with the same parameters as above. Before deleting locally, ensure that the deleted entity has the highest timestamp
- Save the stored value from step 2 (MaxTimestamp) as the new lastReplicationTimestamp
Max
This returns the max timestamp for a specific entity in order to know if there are relevant changes.
?> It is possible the reported max timestamp is irrelevant for the client/consumer (i.e. when using a filter with the related endpoints), in which case it would simply trigger an update routine with no changes.
URL : /:organizationid/:wsmid/api/v1/product/max
URL Parameters: organizationid=[string]
is the ID of the chainbox.io organization.
wsmid=[string]
is the APP ID of the WSM application.
Method: GET
Auth required: YES
Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.
Success Response
Condition: If Organization & WSM app exists and the given credentials are correct.
Code: 200 OK
Content example
{
"offset": "2021-12-01T08:20:16.421Z"
}
Error Responses
Condition: If basic auth header is not present in request or is incorrect.
Code: 401 UNAUTHORIZED
Updates
URL : /:organizationid/:wsmid/api/v1/product/:service/updates
URL Parameters: organizationid=[string]
is the ID of the chainbox.io organization.
wsmid=[string]
is the APP ID of the WSM application.
service=[string]
is the name of the Service Endpoint
registered in the WSM application settings. Supplying "default" as the service
requires no endpoint configuration and will not apply a filter to the result.
Querystring parameters:
to=[date]
returns items with a lastupdated
value less than or equal to this date.
(optional) from=[date]
returns items with a lastupdated
value greater than this date. No default value - not supplying a value will omit this condition.
(optional) lastoffsetid=[string]
returns items with a documentid
greater than this value. This can be used to page through results as the items are sorted by documentid
internally. No default value - not supplying a value will omit this condition.
(optional) limit=[int]
number of items returned. Default = 1000.
Method: GET
Auth required: YES
Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.
Success Response
Condition: If Organization & WSM app exists and the given credentials are correct.
Code: 200 OK
Content example
{
"result": [
{
"createDate": "2021-10-21T12:36:37.167Z",
"createdBy": "System",
"data": {
"revisionId": "fda8e58f-ab69-46e8-9fbe-ba5d9226f719",
"sku": "12345678",
"name": " ",
"datasource": "erp",
"attributedata": {
"dynamicfield-1": "value1",
"dynamicfield-2": "value2",
"dynamicfield-2": 0
}
},
"channels": ["webshop"],
"id": "12345678",
"lastupdated": "2018-11-04T12:22:56.915Z",
"type": "pim-products"
}
],
"nextoffsetid": "12345678"
}
Error Responses
Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED
Condition: Referencing an invalid service parameter. Code: 404 NOT FOUND
Soft deletes
Soft deletes are documents from the same collection not matching the service filter
. If there is no active filter (e.g. using the "default" service) - an empty result will be returned.
URL : /:organizationid/:wsmid/api/v1/product/:service/softdeletes
URL Parameters: organizationid=[string]
is the ID of the chainbox.io organization.
wsmid=[string]
is the APP ID of the WSM application.
service=[string]
is the name of the Service Endpoint
registered in the WSM application settings. Supplying "default" as the service
requires no endpoint configuration and will not apply a filter to the result.
Querystring parameters:
to=[date]
returns items with a lastupdated
value less than or equal to this date.
(optional) from=[date]
returns items with a lastupdated
value greater than this date. No default value - not supplying a value will omit this condition.
(optional) lastoffsetid=[string]
returns items with a documentid
greater than this value. This can be used to page through results as the items are sorted by documentid
internally. No default value - not supplying a value will omit this condition.
(optional) limit=[int]
number of items returned. Default = 1000.
Method: GET
Auth required: YES
Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.
Success Response
Condition: If Organization & WSM app exists and the given credentials are correct.
Code: 200 OK
Content example
{
"result": [
{
"id": "100-01",
"lastUpdated": "2021-07-09T07:42:50.445Z"
},
{
"id": "100-02",
"lastUpdated": "2021-05-05T08:52:41.7Z"
}
],
"nextoffsetid": "100-02"
}
Error Responses
Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED
Condition: Referencing an invalid service parameter. Code: 404 NOT FOUND
Hard deletes
Hard deletes are documents no longer in the collection.
?> It is possible the returned items are irrelevant for the client/consumer (i.e. when using a filter with the related endpoints). Match with existing IDs when appropriate.
URL : /:organizationid/:wsmid/api/v1/product/harddeletes
URL Parameters: organizationid=[string]
is the ID of the chainbox.io organization.
wsmid=[string]
is the APP ID of the WSM application.
Querystring parameters:
to=[date]
returns items with a lastupdated
value less than or equal to this date.
(optional) from=[date]
returns items with a lastupdated
value greater than this date. No default value - not supplying a value will omit this condition.
(optional) lastoffsetid=[string]
returns items with a documentid
greater than this value. This can be used to page through results as the items are sorted by documentid
internally. No default value - not supplying a value will omit this condition.
?> Note that documentid
and item id do not match. Only supply values provided by the endpoint though nextoffsetid
.
(optional) limit=[int]
number of items returned. Default = 1000.
Method: GET
Auth required: YES
Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.
Success Response
Condition: If Organization & WSM app exists and the given credentials are correct.
Code: 200 OK
Content example
{
"result": [
{
"id": "100-03",
"lastUpdated": "2021-12-06T09:40:08.499Z"
}
],
"nextoffsetid": "61adda78880433063295a467"
}
Error Responses
Condition: If basic auth header is not present in request or is incorrect.
Code: 401 UNAUTHORIZED
Built-in Channel filters
In order to avoid creating service endpoints for typical use cases, a built-in channel filter is available via the following endpoints.
Updates by channel
URL : /:organizationid/:wsmid/api/v1/productbychannel/:channel/updates
URL Parameters: organizationid=[string]
is the ID of the chainbox.io organization.
wsmid=[string]
is the APP ID of the WSM application.
channel=[string]
is the name of the channel
on which to filter.
Querystring parameters:
to=[date]
returns items with a lastupdated
value less than or equal to this date.
(optional) from=[date]
returns items with a lastupdated
value greater than this date. No default value - not supplying a value will omit this condition.
(optional) lastoffsetid=[string]
returns items with a documentid
greater than this value. This can be used to page through results as the items are sorted by documentid
internally. No default value - not supplying a value will omit this condition.
(optional) limit=[int]
number of items returned. Default = 1000.
Method: GET
Auth required: YES
Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.
Success Response
Condition: If Organization & WSM app exists and the given credentials are correct.
Code: 200 OK
Content example
{
"result": [
{
"createDate": "2021-10-21T12:36:37.167Z",
"createdBy": "System",
"data": {
"revisionId": "fda8e58f-ab69-46e8-9fbe-ba5d9226f719",
"sku": "12345678",
"name": " ",
"datasource": "erp",
"attributedata": {
"dynamicfield-1": "value1",
"dynamicfield-2": "value2",
"dynamicfield-2": 0
}
},
"channels": ["webshop"],
"id": "12345678",
"lastupdated": "2018-11-04T12:22:56.915Z",
"type": "pim-products"
}
],
"nextoffsetid": 12345678
}
Error Responses
Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED
Soft deletes by channel
URL : /:organizationid/:wsmid/api/v1/productbychannel/:channel/softdeletes
URL Parameters: organizationid=[string]
is the ID of the chainbox.io organization.
wsmid=[string]
is the APP ID of the WSM application.
channel=[string]
is the name of the channel
on which to filter.
Querystring parameters:
to=[date]
returns items with a lastupdated
value less than or equal to this date.
(optional) from=[date]
returns items with a lastupdated
value greater than this date. No default value - not supplying a value will omit this condition.
(optional) lastoffsetid=[string]
returns items with a documentid
greater than this value. This can be used to page through results as the items are sorted by documentid
internally. No default value - not supplying a value will omit this condition.
(optional) limit=[int]
number of items returned. Default = 1000.
Method: GET
Auth required: YES
Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.
Success Response
Condition: If Organization & WSM app exists and the given credentials are correct.
Code: 200 OK
Content example
{
"result": [
{
"id": "100-01",
"lastUpdated": "2021-07-09T07:42:50.445Z"
},
{
"id": "100-02",
"lastUpdated": "2021-05-05T08:52:41.7Z"
}
],
"nextoffsetid": "100-02"
}
Error Responses
Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED