0

$url ="https://marketplace.walmartapis.com/v3/items?nextCursor=250&includeDetails=true&offset=0&limit=20";

this url not working giving error in the walmart.

[error] => Array ( [0] => Array ( [code] => INVALID_REQUEST.GMP_ITEM_QUERY_API [field] => 400_BAD_REQUEST [description] => Bad Request. Missing Important Headers ( like ConsumerId) or Inputs. [info] => Request invalid. [severity] => ERROR [category] => DATA )

    )
  • What are you trying to do? What do you expect this to do? It looks like the header is missing some info. Could you post that, and the code you use to send the request? – toastifer Mar 24 '21 at 11:52
  • i just want to get all items that is 3000 so i am unable to get it of i am trying it get by setting offset value but api is retuning from starting offset. – Nitin agrawal Mar 24 '21 at 12:20

1 Answers1

0

I haven't been able to get the offset to work, but you can use the nextCursor parameter to page through the list.

The nextCursor=250 part is what's causing the 400 Bad request error. That's not how it's used, or what the API is expecting. Leave it off completely for your first request: https://marketplace.walmartapis.com/v3/items?includeDetails=true&offset=0&limit=20

Then use the value of the nextCursor from the response you get as the parameter for the next call. https://marketplace.walmartapis.com/v3/items?nextCursor=VGhpc1dvdWxkQmVUaGVuZXh0Q3Vyc29yVmFsdWU=

toastifer
  • 478
  • 3
  • 8