REST API: GET miniview subprofiles

Subprofiles are to a collection what regular profiles are to a database. To request the subprofiles that represent a certain profile from a miniview you can send an HTTP GET request to the following URL:$id/subprofile?access_token=xxxx

The $id should be replaced with the numerical identifier of the miniview you're requesting the subprofiles of.

Available parameters

This method supports the dataonly parameter. This boolean can be used to only retrieve the profile data when set to true, allowing the call to be processed faster.

Paging parameters start, limit and total are also supported. More information about these parameters can be found in the article on paging.

Returned fields

This method returns a JSON object with the subprofiles under the data property. Each subprofile contains the following fields:

  • ID: Numerical ID of the subprofile.
  • secret: The "secret" code linked to a subprofile.
  • fields: Associative array of field names and values.
  • profile: Numerical ID of the profile the subprofile belongs to.
  • collection: ID of the collection where the subprofile is stored.
  • created: Timestamp for creation of subprofile in YYYY-MM-DD hh:mm:ss format.
  • modified: Timestamp for last edit of subprofile in YYYY-MM-DD hh:mm:ss format.
  • removed: Indicates whether the subprofile has been removed or not.

JSON example

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

   "created":"2008-08-25 16:14:56",
   "modified":"2010-08-25 16:15:56",

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", 2);

// do the call, and print result

The example above requires the CopernicaRestApi class.

More information