REST API v4: POST view parent
The HTTP POST method set a new parent of a selection is available at the following address:
https://api.copernica.com/v4/view/$id/parent
The $id must be replaced with the unique identifier of the selection.
Available parameters
The following properties can be passed in the message body. At least a database must be provided.
- database: ID of the database under which the view should be moved
- view: Optional ID of the view under which the view should be moved. If this is empty, the view will be moved directly under the database.
JSON example
The following JSON demonstrates how to use the API method:
{
"database": 1,
"view": 24
}
PHP example
The following PHP script demonstrates how to call the API method:
// required scripts
require_once('CopernicaRestAPI.php');
// change this to your access token
$api = new CopernicaRestAPI("your-access-token", 4);
// the parameters
$params = [
"database" => 1,
"view" => 24,
];
// execute the request
$api->post("view/{$viewID}/move", $params);
This example requires the REST API class.