Collections
...
Collections API
Collections
List Collections
5 min
list collections you can list all of the collections currently set up on your account by making making a http get request to the /collections endpoint note that the collection list endpoint is rate limited to 60 requests per minute for real time updates as to your collection status it is recommended you use webhooks parameters the following querystring (http get) parameters allow you to refine the results returned by the collections list api true falsefalse left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type false left unhandled content type example get get /collections in the example below we list all the collections on your account http https //api backyardapi com/collections?api key=demo$ curl "https //api backyardapi com/collections?api key=demo"const axios = require('axios'); const params = { api key 'demo' } axios get('https //api backyardapi com/collections?api key=demo') then(response => { const apiresponse = response data; console log("total collections ", apiresponse total count); apiresponse collections map((collection, number) => console log((number + 1) + ' ' + collection name); }) catch(error => { console error(error); });import requests params = { 'api key' 'demo' } api result = requests get('https //api backyardapi com/collections', { params }) api response = api result json() print "total collections ", api response\['total count'] for number, collection in enumerate(api response\['collections'], start=1) print "%s %s" % (number, collection\['name'])\<?php $querystring = http build query(\[ 'api key' => 'demo', ]); $ch = curl init(sprintf('%s?%s', 'https //api backyardapi com/collections', $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); $json = curl exec($ch); curl close($ch); $api result = json decode($json, true); print r($api result); echo "total collections ", $api result\['total count'], php eol; foreach ($api result\['collections'] as $number => $collection) { echo "{$number} {$collection\['name']}", php eol; } ?> backyard api responds with the following json showing all the collections on your backyard api account { "request info" { "success" true }, "total count" 2, "total pages" 1, "current page" 1, "count this page" 2, "collections" \[ { "id" "2a6f94bb", "created at" "2020 01 01t00 00 01 000z", "last run" "2020 09 01t00 00 00 000z", "name" "my second collection", "schedule type" "weekly", "priority" "normal", "destination ids" \[ "destination id 1", "destination id 2" ], "enabled" true, "status" "idle", "requests total count" 0, "requests page count" 0, "next result set id" 1, "results count" 0, "schedule days of week" \[ 0, 3 ], "schedule hours" \[ 8 ], "notification email" "john smith\@example com", "notification as json" false, "notification as jsonlines" false, "notification as csv" false }, { "id" "cac8651d", "created at" "2020 01 02t00 00 00 000z", "last run" "2020 09 01t00 10 00 000z", "name" "my first collection", "schedule type" "daily", "priority" "normal", "destination ids" \[], "enabled" true, "status" "idle", "requests total count" 0, "requests page count" 0, "results count" 0, "schedule hours" \[ 9, 17 ], "notification email" "john smith\@example com", "notification as json" false, "notification as csv" true } ] } next steps webhook https //docs trajectdata com/backyardapi/collections api/collections/webhook list requests https //docs trajectdata com/backyardapi/collections api/requests/list list result sets https //docs trajectdata com/backyardapi/collections api/results/list