Documentation

timeman.timecontrol.report.add

The method is used to send report on the detected workplace absence.

Parameters

ParameterExampleRequiredDescription
ID 468 Yes Record ID.
TYPE work Yes Type of absence (work - due to work-related issues, private - due to private matters).
TEXT 'Away for a lunch break' Yes Description of the reason for absence.
CALENDAR true No Enter the absence into calendar (only for the initial report).
USER_ID 2 No User ID for which the report is prepared (the field is available only for administrators).

Call example

JavaScript

BX24.callMethod('timeman.timecontrol.report.add', {
	'id': 468,
	'type': 'private',
	'text': 'Away for a lunch break',
	'calendar': true
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('timeman.timecontrol.report.add', Array(
	'ID' => 468,
	'TYPE' => 'private',
	'TEXT' => 'Away for a lunch brea',
	'CALENDAR' => true
), $_REQUEST["auth"]);	

Response example

{    
	"result": true
}

Response example in case of an error

{
    "error": "TEXT_EMPTY",
    "error_description": "Text can't be empty"
}
  • Key error - error code.
  • Key error_description - brief error description.

Possible error codes

CodeDescription
TEXT_EMPTYReason for absence is not provided.
ACCESS_ERRORYou don't have access to this report.


© «Bitrix24», 2001-2023
Up