REST API v4: GET collection

A collection is somewhat like a second layer within a database. These collections have a numerical ID which can be used to fetch information with an HTTP GET request to the following URL:$id

The $id here should be replaced with the numerical identifier of the collection.

Returned fields

The method returns a JSON object that 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/pdf).

JSON example

The JSON for this method might look something like this:


PHP example

The following PHP scripts is an example of how to call this API method:

// dependencies

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

// execute the call and print the result.

The example above requires the CopernicaRestApi class.

More information