Skip to content

Latest commit



89 lines (69 loc) · 2.77 KB

File metadata and controls

89 lines (69 loc) · 2.77 KB

REST API: GET database collections

This method is used to request all collections in a database. It is an HTTP GET call to the following address:$id/collections

In this, $id should be replaced by the numerical identifier or the name of the database you want to request the collections from.

Available parameters

This method only support paging parameters. More information on these parameters can be found in the article on paging.

Returned fields

The method returns a JSON object that contains a 'data' property with all the collections for the database. Each collection contains the following fields:

Variable Description
ID The ID of the collection.
name Name of the collection.
database ID of the database this collection belongs to.
fields Array with the fields in the collection.
intentions Array with the intentions for the collection (either 1 or null for email/sms/fax/pdf).

JSON example

The JSON for a single collection might look something like this:


PHP example

The following PHP script demonstrates how to use the API method:

// dependencies

// change this into your access token
$api = new CopernicaRestAPI("your-access-token", 4);

// parameters to pass to the call
$parameters = array(
   'limit'     =>  100
// do the call, and print result
print_r($api->get("database/{$databaseID}/collections", $parameters));

The example above requires the CopernicaRestApi class.

More information