REST API v3: POST profile lock

To lock a profile to a specific selection, you can send an HTTP POST request to the following URL:

https://api.copernica.com/v3/profile/$id/lock

The $id in the URL must be replaced with the numerical identifier of the profile you want to lock. The identifier of the selection (view) to which the profile should be locked, must be provided in the body of the request.

Required parameters

This method requires the following parameters:

  • $id: The ID of the profile to be locked (in the URL).
  • view: The ID of the selection to which the profile should be locked (in the request body).

Request body

The body of the POST request must contain the view parameter with the ID of the selection.

{
  "view": 12345
}

PHP example

The following PHP script demonstrates how to use this API method:

// required scripts
require_once('CopernicaRestAPI.php');

// change this to your access token
$api = new CopernicaRestAPI("your-access-token", 3); // Assuming v3 for this example

// data for the request, including the ID of the selection
$data = array(
    'view' => $viewID // ID of the selection to which the profile should be locked
);

// execute the request
// $profileID is the ID of the profile
$api->post("profile/{$profileID}/lock", $data);

// On a successful operation, the API will return an X-locked header
// and an HTTP 200 OK status.

This example requires the REST API class.

More information