REST API: GET miniview (miniselection) subprofiles

Subprofiles are to a collection what regular profiles are to a database. You can request all subprofiles from a miniview with an HTTP GET call to the following URL:$id/subprofile

The $id should be replaced with the numerical identifier of the miniview you want to fetch the subprofiles of. Since this can be quite a time-consuming call it is possible to use the 'dataonly' property to speed it up.

Available parameters

The following parameters can be added to the URL as variables:

  • start: First ID to retrieve
  • limit: Length of the batch
  • total: Boolean. Indicates whether to show the total or not. Setting this to 'false' will speed up the call.
  • fields: Optional parameter to set conditions for subprofiles that should be returned.
  • dataonly: Boolean. If set to true the method will only retrieve the ID, fields, collection ID, profile ID and modified date to speed up the call.


More information on the start, limit and total parameters can be found in the article on paging.


The fields parameter can be used to select subprofiles. For example, if you only want to request subprofiles where the field “country” equals “The Netherlands”, you can do so using “fields”. More information on this parameter can be found in the article on the “fields” parameter.

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.

Please note that some of these fields will not be available if the dataonly parameter has been set to true.

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

// do the call, and print result

The example above requires the CopernicaRestApi class.

More information