REST API v3: POST view views (nested selections)

Copernica supports nested selections. To add a nested selection you can send a HTTP POST request to the following URL:

https://api.copernica.com/v3/view/$id/views?access_token=xxxx

The $id needs to be replaced by the numerical identifier of the selection. After a successful call the ID of the created request is returned.

Available parameters

The following parameters can be added to the message body. Note that because this is a nested view it has the exact same properties as a regular view.

  • name: Name of the selection
  • description: Description of the selection

JSON example

The following JSON demonstrates how to use the API method:

{
    "name": "new_view_name",
    "description": "new view description"
}

PHP example

The following PHP example demonstrates how to use the method:

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

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

// parameters to pass to the call
$data = array(
    'name'            =>  'name_of_the_selection',
    'description'     =>  'new description'
);

// do the call
$api->post("view/{$viewID}/views", $data);

// return id of created request if successful

The example above requires the CopernicaRestApi class.

More information