Get the text of the agreement userconsent.agreement.text
Scope:
userconsentWho can execute the method: any user
The method userconsent.agreement.text returns the text of the agreement.
Method Parameters
Required parameters are marked with *
|
Name |
Description |
|
id* |
Identifier of the agreement. The identifier can be obtained using the method userconsent.agreement.list |
|
replace |
Array of replacements for text substitution. Available keys:
The list of available fields is described below Substitution is performed only for standard agreements created based on templates. For custom agreements with arbitrary HTML text, the parameter is ignored |
Parameter fields
|
Name |
Description |
|
COMPANY_NAME |
Company name |
|
COMPANY_ADDRESS |
Company address |
|
PURPOSES |
Purpose of data processing |
|
THIRD_PARTIES |
Third parties to whom data is transferred |
|
EMAIL |
Email address |
Code Examples
How to Use Examples in Documentation
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":19,"replace":{"button_caption":"I agree","fields":{"COMPANY_NAME":"Example Ltd.","COMPANY_ADDRESS":"New York, Example St., 1","PURPOSES":"Processing personal data to improve service","THIRD_PARTIES":"Company partners for analytics","EMAIL":"info@example.com"}}}' \
https://**put_your_bitrix24_address**/rest/**put_your_user_id_here**/**put_your_webhook_here**/userconsent.agreement.text
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":19,"replace":{"button_caption":"I agree","fields":{"COMPANY_NAME":"Example Ltd.","COMPANY_ADDRESS":"New York, Example St., 1","PURPOSES":"Processing personal data to improve service","THIRD_PARTIES":"Company partners for analytics","EMAIL":"info@example.com"}},"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/userconsent.agreement.text
try {
const response = await $b24.callMethod(
'userconsent.agreement.text',
{
id: 19,
replace: {
button_caption: 'I agree',
fields: {
COMPANY_NAME: 'Example Ltd.',
COMPANY_ADDRESS: 'New York, Example St., 1',
PURPOSES: 'Processing personal data to improve service',
THIRD_PARTIES: 'Company partners for analytics',
EMAIL: 'info@example.com'
}
}
}
);
const result = response.getData().result;
console.log('Result:', result);
processResult(result);
} catch (error) {
console.error('Error:', error);
}
try {
$response = $b24Service
->core
->call(
'userconsent.agreement.text',
[
'id' => 19,
'replace' => [
'button_caption' => 'I agree',
'fields' => [
'COMPANY_NAME' => 'Example Ltd.',
'COMPANY_ADDRESS' => 'New York, Example St., 1',
'PURPOSES' => 'Processing personal data to improve service',
'THIRD_PARTIES' => 'Company partners for analytics',
'EMAIL' => 'info@example.com'
]
]
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
processData($result);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
BX24.callMethod(
'userconsent.agreement.text',
{
id: 19,
replace: {
button_caption: "I agree",
fields: {
COMPANY_NAME: "Example Ltd.",
COMPANY_ADDRESS: "New York, Example St., 1",
PURPOSES: "Processing personal data to improve service",
THIRD_PARTIES: "Company partners for analytics",
EMAIL: "info@example.com"
}
}
},
function(result) {
if(result.error()) {
console.error(result.error());
} else {
console.log(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'userconsent.agreement.text',
[
'id' => 19,
'replace' => [
'button_caption' => 'I agree',
'fields' => [
'COMPANY_NAME' => 'Example Ltd.',
'COMPANY_ADDRESS' => 'New York, Example St., 1',
'PURPOSES' => 'Processing personal data to improve service',
'THIRD_PARTIES' => 'Company partners for analytics',
'EMAIL' => 'info@example.com'
]
]
]
);
echo '<PRE>';
print_r($result);
echo '</PRE>';
Response Handling
HTTP Status: 200
{
"result": {
"LABEL": "By clicking the 'I agree' button, I consent to the processing of my personal data in accordance with Federal Law No. 152-FZ of July 27, 2006 'On Personal Data', under the conditions and for the purposes defined in the Consent to the processing of personal data",
"TEXT": "Consent to the processing of personal data\n\nHereby, in accordance with Federal Law No. 152-FZ 'On Personal Data' of July 27, 2006, I freely, of my own will and in my interest express my unconditional consent to the processing of my personal data, registered in accordance with the legislation of the USA at the address: \n (hereinafter referred to as the Operator).\n1. Consent is given for the processing of one, several, or all categories of personal data, which are not special or biometric, provided by me, which may include:\n\n- Example Ltd.;\n- New York, Example St., 1;\n- Processing personal data to improve service;\n- Company partners for analytics;\n- info@example.com.\n\n2. The Operator may perform the following actions: collection; recording; systematization; accumulation; storage; clarification (updating, modification); extraction; use; blocking; deletion; destruction. \n\n3. Methods of processing: both using automation tools and without their use.\n\n4. Purpose of processing: providing me with services/work, including sending notifications regarding the services/work provided, preparing and sending responses to my requests, sending me information about events/products/services/work of the Operator.\n\n5. Since the Operator may process my personal data using the software 'QuickBooks and other similar platforms', I give my consent to the Operator to carry out the corresponding assignment to Example Ltd., (OGRN 5077746476209), registered at the address: 109544, New York, Enthusiast Blvd., 2, floor 13, room 8-19.\n\n6. This consent is valid until revoked by sending a corresponding notification to the email address test@example.com or by sending it to the address.\n\n7. In case I revoke my consent to the processing of personal data, the Operator has the right to continue processing personal data without my consent if there are grounds provided by Federal Law No. 152-FZ 'On Personal Data' of July 27, 2006."
},
"time": {
"start": 1760611223,
"finish": 1760611223.240694,
"duration": 0.2406940460205078,
"processing": 0,
"date_start": "2025-10-16T13:40:23+02:00",
"date_finish": "2025-10-16T13:40:23+02:00",
"operating_reset_at": 1760611823,
"operating": 0
}
}
Returned Data
|
Name |
Description |
|
result |
Root element of the response |
|
LABEL |
Title of the agreement |
|
TEXT |
Text of the agreement |
|
time |
Information about the request execution time |
Error Handling
HTTP Status: 400
{
"error":"400",
"error_description":"Parameter `Agreement ID` required."
}
|
Name |
Description |
|
error |
String error code. It may consist of digits, Latin letters, and underscores |
|
error_description |
Textual description of the error. The description is not intended to be shown to the end user in its raw form |
Possible Error Codes
|
Status |
Code |
Description |
Value |
|
|
|
Parameter |
Parameter |
|
|
|
Agreement with id |
Agreement with the specified |
Statuses and System Error Codes
HTTP Status: 20x, 40x, 50x
The errors described below may occur when calling any method.
|
Status |
Code |
Description |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
An internal server error has occurred, please contact the server administrator or Bitrix24 technical support |
|
|
|
The request intensity limit has been exceeded |
|
|
|
The current method is not allowed to be called using batch |
|
|
|
The maximum length of parameters passed to the batch method has been exceeded |
|
|
|
Invalid access token or webhook code |
|
|
|
The methods must be called using the HTTPS protocol |
|
|
|
The REST API is blocked due to overload. This is a manual individual block, to remove it you need to contact Bitrix24 technical support |
|
|
|
The REST API is available only on commercial plans |
|
|
|
The user whose access token or webhook was used to call the method lacks permissions |
|
|
|
The manifest is not available |
|
|
|
The request requires higher privileges than those provided by the webhook token |
|
|
|
The provided access token has expired |
|
|
|
The user does not have access to the application. This means that the application is installed, but the account administrator has allowed access to this application only for specific users |
|
|
|
The public part of the site is closed. To open the public part of the site on an on-premise installation, disable the option "Temporary closure of the public part of the site". Path to the setting: Desktop > Settings > Product Settings > Module Settings > Main Module > Temporary closure of the public part of the site |