SDAPI Pagination 2.0
The Script Debugger API uses paging whenever it accesses a collection
of
Object Member
resource instances. Paging
enables the API to return data in chunks, instead of returning a complete
collection all at once. You explicitly configure paging by providing
values for the start
and count
parameters:
-
start
: Specifies the start location of the chunk within the collection of resource elements. Valid values range must be at least 0; the default value is 0. The start location is not a page number; it is the position of the start element within the entire collection. -
count
: Specifies the number of resource instances to return in each chunk. Valid values range from 1 to 200; the default value is 200.
The start
and count
parameters are
optional
In the following example, a Object Members request yields a collection
of 30 total resource instances. The start
property
specifies that the requested chunk should start at position 15, and the
count
element specifies that the chunk should contain at
most 30 resource instances. The response also contains the
total
property that identifies the total number of
results that satisfied the request.
REQUEST:
GET /s/-/dw/debugger/v1_0/thread/2/frame/0/members?object_path=b.productLineItems.[1]&start=15&count=30 HTTP/1.1
Host: example.com
Accept: application/json
RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
{
"_v":"2.0",
"count":30,
"object_members":[
{"name":"externalLineItemText","parent":"productLineItems","type":"String","value":"null"},
{"name":"gift","parent":"productLineItems","type":"String","value":"false"},
{"name":"giftMessage","parent":"productLineItems","type":"String","value":"null"},
{"name":"grossPrice","parent":"productLineItems","type":"dw.value.Money","value":"N/A"},
{"name":"lastModified","parent":"productLineItems","type":"java.util.Date","value":"Tue Nov 10 21:00:19 GMT 2015"},
{"name":"lineItemCtnr","parent":"productLineItems","type":"dw.order.Basket","value":"[Basket uuid=bcwbIiWaYNNEoaaadoUaAVmTkX]"},
{"name":"lineItemText","parent":"productLineItems","type":"String","value":"Platinum Blue Stripes Easy Care Fitted Shirt "},
{"name":"manufacturerName","parent":"productLineItems","type":"String","value":"null"},
{"name":"manufacturerSKU","parent":"productLineItems","type":"String","value":"null"},
{"name":"minOrderQuantity","parent":"productLineItems","type":"dw.value.Quantity","value":"Quantity: value=1, unit="},
{"name":"minOrderQuantityValue","parent":"productLineItems","type":"String","value":"1.0"},
{"name":"netPrice","parent":"productLineItems","type":"dw.value.Money","value":"N/A"},
{"name":"optionID","parent":"productLineItems","type":"String","value":"null"},
{"name":"optionModel","parent":"productLineItems","type":"String","value":"null"},
{"name":"optionProductLineItem","parent":"productLineItems","type":"String","value":"false"},
{"name":"optionProductLineItems","parent":"productLineItems","type":"dw.util.Collection","value":"[Collection id=1332927407]"},
{"name":"optionValueID","parent":"productLineItems","type":"String","value":"null"},
{"name":"orderItem","parent":"productLineItems","type":"String","value":"null"},
{"name":"parent","parent":"productLineItems","type":"String","value":"null"},
{"name":"position","parent":"productLineItems","type":"String","value":"2"},
{"name":"price","parent":"productLineItems","type":"dw.value.Money","value":"N/A"},
{"name":"priceAdjustments","parent":"productLineItems","type":"dw.util.Collection","value":"[Collection id=1609064674]"},
{"name":"priceValue","parent":"productLineItems","type":"String","value":"null"},
{"name":"product","parent":"productLineItems","type":"dw.catalog.Variant","value":"[Variant sku=008884303996]"},
{"name":"productID","parent":"productLineItems","type":"String","value":"008884303996"},
{"name":"productInventoryList","parent":"productLineItems","type":"String","value":"null"},
{"name":"productInventoryListID","parent":"productLineItems","type":"String","value":"null"},
{"name":"productListItem","parent":"productLineItems","type":"String","value":"null"},
{"name":"productName","parent":"productLineItems","type":"String","value":"Platinum Blue Stripes Easy Care Fitted Shirt "},
{"name":"proratedPrice","parent":"productLineItems","type":"dw.value.Money","value":"N/A"}],
"start":15,
"total":59
}