List Requests
List Requests
You can List the Requests for a Collection by making making a HTTP GET request to the /collections/COLLECTION_ID/requests/PAGE endpoint (where COLLECTION_ID is the id of the Collection to get Requests for, and PAGE is the page of Requests to get).
The /collections/COLLECTION_ID/requests/PAGE endpoint returns the Requests for a Collection in pages of 1000 Requests per page. Pages start at 1 . You can find out how many pages a Collection has by inspecting the requests_page_count field returned from the Get Collection endpoint.
BlueCart API also provides two more endpoints to allow you to retrieve a download link for all Requests in a Collection, in either JSON or CSV format.
List Requests by Page
GET /collections/COLLECTION_ID/requests/PAGE
In the example below we List page 1 of the Requests for the Collection with id=123456 :
https://api.bluecartapi.com/collections/123456/requests/1?api_key=demoBlueCart API responds with the following JSON showing all the Requests on page 1 of the Collection:
{
"request_info": {
"success": true
},
"collection_id": "123456",
"requests_page_current": 1,
"requests_page_count": 1,
"requests": [
{
"type": "product",
"customer_zipcode": "77001",
"item_id": "782866746",
"custom_id": "MyCustomID_001",
"id": "ABCDEFGHIJKLMNOP"
}
]
}Get JSON Download Links
GET /collections/COLLECTION_ID/requests/json
In the example below we retrieve download links for all Requests for Collection with id=123456 in JSON format:
https://api.bluecartapi.com/collections/123456/requests/json?api_key=demoBlueCart API responds with the following JSON detailing the total number of Requests requests_total_count , the total number of pages requests_page_count and a JSON file download_link for each page:
{
"request_info": {
"success": true
},
"collection_id": "123456",
"requests_total_count": 1,
"requests_page_count": 1,
"download_links": {
"pages": [
"https://requests.bluecartapi.com/Collection_Requests_123456_Page_1.json"
]
}
}Get CSV Download Links
GET /collections/COLLECTION_ID/requests/csv
In the example below we retrieve download links for all Requests for Collection with id=123456 in CSV format:
https://api.bluecartapi.com/collections/123456/requests/csv?api_key=demoBlueCart API responds with the following JSON detailing the total number of Requests requests_total_count , the total number of pages requests_page_count and a CSV file download_link for each page:
{
"request_info": {
"success": true
},
"collection_id": "123456",
"requests_total_count": 1,
"requests_page_count": 1,
"download_links": {
"pages": [
"https://requests.bluecartapi.com/Collection_Requests_123456_Page_1.csv"
]
}
}Next Steps Listing Result Sets Getting Result Sets