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:

https://api.copernica.com/v2/miniview/$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:

{  
   "ID":"20285",
   "secret":"132879300b4731870080b1cd301fd43d",
   "fields":{  
   },
   "profile":"2139358",
   "collection":"6312",
   "created":"2008-08-25 16:14:56",
   "modified":"2010-08-25 16:15:56",
   "removed":false
}

PHP Example

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

// dependencies
require_once('copernica_rest_api.php');

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

// do the call, and print result
print_r($api->get("miniview/{$miniviewID}/subprofiles"));

The example above requires the CopernicaRestApi class.

More information