REST API v3: GET profile locks
This method can be used to retrieve the selections to which a profile is locked.
Keep in mind that $id
should always be replaced with the numerical
identifier of the profile whose locks you are requesting.
List of selection locks
A list of selections to which a profile is locked can be requested by sending an HTTP GET request to the following URL:
https://api.copernica.com/v3/profile/$id/locks
This call returns a list of JSON objects. Each object in the array represents a selection to which the profile is locked and has the following properties:
Variable | Description |
---|---|
id | Unique numeric identifier of the selection. |
name | Name of the selection. |
description | Description of the selection. |
parent-type | Type of the parent (view/database). |
parent-id | ID of the parent. |
has-children | Boolean indicating whether the selection itself contains selections. |
has-referred | Boolean indicating whether other selections refer to this selection. |
has-rules | Boolean indicating whether the selection has rules. |
database | ID of the database to which this selection belongs. |
last-built | Timestamp of the last build of the selection. |
intentions | Array with the intentions for this selection (1 or null for email/sms/pdf). |
archived | Boolean indicating whether the selection is archived. |
JSON example
The JSON for a selection looks like this, for example:
{
"ID":"1384",
"name":"Leadscoring",
"description":"",
"parent-type":"database",
"parent-id":"7616",
"has-children":false,
"has-referred":false,
"has-rules":true,
"database":"7616",
"last-built":"2019-04-17 00:21:26",
"intentions":{"email": false,"sms": false,"fax": false,"pdf": false},
"archived": false
}
PHP example
The following PHP script demonstrates how to use the 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
// execute the request and print the result
print_r($api->get("profile/{$profileID}/locks"));
This example requires the REST API class.