Returns the collection models for top level collections, subcollections of the specified parent_collection_id, or collections that match the specified query string. Use the Range header to specify the number of collections returned (default is the first 20).

Query parameters

NameTypeDescriptionRequired?
filter string Returns only collections that match the specified attribute (currently display_name is the only attribute supported by this parameter). For example, filter=display_name=Companies returns only collections named “Companies”; filter=display_name<G returns only collections with names with first letter less than ‘G’. You cannot combine this with the query parameter. false
has_tag array Returns only collections tagged with the specified tags (for example, has_tag=construction&has_tag=real%20estate). If you specify multiple tags, the API returns collections with any of the tags (OR). false
in_collection_id string Works in conjunction with query and returns only collections within the specified collection. false
mode string Values: advanced phrase simple
Defaults to simple.
false
parent_collection_id string Returns only collections whose immediate parent collection ID matches the one specified. false
phrase_distance integer If mode=phrase, this specifies the proximity search distance. For example, if query=sovereign%20country and phrase_distance=0, the two words must be next to each other. If phrase_distance=1, it also matches 'sovereign island country'. false
query string Returns only collections that include the specified text in the collection metadata. You cannot combine this with the filter parameter. false
sort string The collection attribute to sort the results by (defaults to display_name). false

Try it out

Enter any desired query parameters and click Send to view the response:

GET https://public.enigma.com/api/collections/?


Responses

CodeReturns
200 The collection model for each collection.
206 The collection model for each collection.
400 Parameter not allowed
401 Invalid login credentials
404 Requested resource not found

Examples

This example gets the first two top-level collections, ordered by display_name, in ascending order (default settings).

$ curl -X GET 'https://public.enigma.com/api/collections/' -H 'Range: resources=0-1'

This example returns the first collection with the words “federal” and “reserve” in the metadata.

$ curl -X GET 'https://public.enigma.com/api/collections/?query=federal%20reserve' -H 'Range: resources=0-0'

This example returns all collections with the specified parent collection.

$ curl -X GET 'https://public.enigma.com/api/collections/?parent_collection_id=52dfb31c-f22e-49fb-bc05-8f5d8a5e7cab'

Example HEAD request

This example uses a HEAD request to return the HTTP headers. The Content-Range setting indicates how many resources (collections) are in the specified parent collection (8 in this example).

Request

$ curl --head 'https://public.enigma.com/api/collections/?parent_collection_id=52dfb31c-f22e-49fb-bc05-8f5d8a5e7cab' -H 'Authorization: Bearer <APIKEY>'

Response

HTTP/1.1 200 OK
Date: Fri, 07 Jul 2017 14:30:57 GMT
Content-Type: application/vnd.enigma+json; version=1
Content-Length: 8455
Connection: keep-alive
Server: nginx/1.13.2
Content-Range: resources 0-7/8
ETag: "d7288d2abb70720af543995ab7176287"
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9999
X-RateLimit-Reset: 1499437858
Retry-After: 0
Access-Control-Allow-Origin: *
X-Upstream: 10.10.155.142:5000