Retrieve Items
Where is that thing?
You can usually retrieve items from all our Building Blocks in two ways. Either with a straight GET
call or using the more advanced GET
request, search
. Check the respective Building Block for detailed examples.
You can use filtering, pagination and sorting to navigate through the ginormous lists you'll get if you, for example, GET /products
and you have a million products.
List Items
This is a straight GET
call to our APIs. Here's an example that lists all your Orders, but it works the same for all the Building Blocks.
Note: You may not need the Authorization header to retrieve certain items. For example, you'd want to be able to show your products to people without requiring them to have a valid JWT. I.e., you don't have to sign in to search Amazon's website. Your user's payment methods, on the other hand, would require it.
For information about the pagination, see Pagination.
Search for Items
This method allows you to retrieve a list of items, like user_name
or account_number
, that match a search query without specifying that you are searching for user_name
or account_number
. Check the respective Building Block for detailed examples, but here's an example of searching for a particular order.
For information about the pagination, see Pagination.
Search by Tag
The Building Blocks Users, Products and Resources can all have tags
added to them.
There are three ways to search by tag. You can search for:
Any item that has that tag, even if they have other
tags
, too. E.g. all items that haveglove
as atag
. Code:?tags=tag_1
Items that have multiple tags. E.g. all items that have
glove
andblack
as atag
. Code:?tags=tag_1+tag_2
Items that have only one tag. E.g. a really boring
glove
that has no othertags
. Code:?tags=tag_1+
You can combine these into complex searches.
e.g.: ?tags=glove+red,skis+,socks
The above would return all products that have both red
and glove
tags, all products that only are tagged with ski
, and all the socks
.
Last updated