Collections
...
Collections API
Requests
Clear Requests
4min
clear requests all of the requests in a collection can be cleared by making an http delete request to the /collections/collection id/clear endpoint (where collection id is the id of the collection) collection status collections can only be cleared from a collection when it is not running to check whether a collection is currently running use the get collection https //docs trajectdata com/bluecartapi/collections api/collections/get endpoint example delete delete /collections/collection id/clear in the example below we clear a collection with id=123456 $ curl x delete "https //api bluecartapi com/collections/123456/clear?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios delete('https //api bluecartapi com/collections/123456/clear', { params }) then(response => { console log('request deleted '); }) catch(error => { console log(error); });import requests api result = requests delete('https //api bluecartapi com/collections/123456/clear?api key=demo') print ("request deleted ")\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api bluecartapi com/collections/123456/clear', $querystring)); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); curl setopt($ch, curlopt customrequest, "delete"); $json = curl exec($ch); curl close($ch); echo "request deleted ", php eol; ?> bluecart api responds with a json object confirming that the collection has been cleared { "request info" { "success" true, "message" "collection requests cleared" } } next steps update request https //docs trajectdata com/bluecartapi/collections api/requests/update list request https //docs trajectdata com/bluecartapi/collections api/requests/list