sign.b2e.hcmlink.document.get
Получить подписанный документ HCM Link
Описание
Метод sign.b2e.hcmlink.document.get возвращает данные подписанного документа КЭДО, который связан с HCM Link.
Метод работает только в контексте авторизации приложения. Метод доступен, если на Битрикс24 доступна интеграция HCM Link.
Параметры
id
integer
обязательный
Идентификатор участника подписания.
Получить идентификатор можно из поля data.id события OnSignHcmLinkB2eDocumentSigned
Примеры запроса
curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"id":3942,"auth":"**put_access_token_here**"}' \
https://**put_your_bitrix24_address**/rest/sign.b2e.hcmlink.document.get
// This snippet is an ES module: top-level await requires type="module" or a bundler.
// $b24 is an already-initialized SDK instance (see the SDK "Get started" guide).
import { Text } from '@bitrix24/b24jssdk'
import type { B24Frame, ISODate } from '@bitrix24/b24jssdk'
declare const $b24: B24Frame
type HcmLinkDocument = {
company: string
employee: string
document: {
date: ISODate
name: string
fileUrl: string
fileName: string
uid: string | null
documentUid: string | null
}
}
try {
const response = await $b24.actions.v2.call.make<HcmLinkDocument>({
method: 'sign.b2e.hcmlink.document.get',
params: {
id: 3942,
},
requestId: Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
} else {
const result = response.getData()!.result
console.info(result.company, result.employee, result.document.fileName)
}
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
<!-- Load the SDK (UMD build); it is exposed as the global B24Js -->
<script src="https://unpkg.com/@bitrix24/b24jssdk@1/dist/umd/index.min.js"></script>
<script>
async function getHcmLinkDocument() {
try {
// Initialize the SDK inside a Bitrix24 frame
const $b24 = await B24Js.initializeB24Frame()
const response = await $b24.actions.v2.call.make({
method: 'sign.b2e.hcmlink.document.get',
params: {
id: 3942,
},
requestId: B24Js.Text.getUuidRfc4122()
})
// The payload is available only on a successful response
if (!response.isSuccess) {
console.error(response.getErrorMessages().join('; '))
return
}
const result = response.getData().result
console.info(result.company, result.employee, result.document.fileName)
} catch (error) {
// Thrown on transport or SDK failures (AjaxError, SdkError, etc.)
console.error(error)
}
}
document.addEventListener('DOMContentLoaded', getHcmLinkDocument)
</script>
try {
$response = $b24Service
->core
->call(
'sign.b2e.hcmlink.document.get',
[
'id' => 3942
]
);
$result = $response
->getResponseData()
->getResult();
echo 'Success: ' . print_r($result, true);
} catch (Throwable $e) {
error_log($e->getMessage());
echo 'Error: ' . $e->getMessage();
}
BX24.callMethod(
'sign.b2e.hcmlink.document.get',
{
id: 3942
},
result => {
if (result.error()) {
console.error(result.error());
} else {
console.dir(result.data());
}
}
);
require_once('crest.php');
$result = CRest::call(
'sign.b2e.hcmlink.document.get',
[
'id' => 3942
]
);
if (isset($result['error'])) {
echo 'Ошибка: ' . $result['error_description'];
} else {
echo '<PRE>';
print_r($result['result']);
echo '</PRE>';
}
// client и ctx уже созданы — см. раздел «SDK для Go»
res, err := client.Core().Call(ctx, "sign.b2e.hcmlink.document.get", b24.Params{
"id": 3942,
}, b24.WithIdempotent())
if err != nil {
return fmt.Errorf("sign.b2e.hcmlink.document.get: %w", err)
}
var item struct {
Company string `json:"company"`
Employee string `json:"employee"`
Document struct {
FileName string `json:"fileName"`
} `json:"document"`
}
if err := json.Unmarshal(res.Result, &item); err != nil {
return fmt.Errorf("разбор ответа: %w", err)
}
fmt.Println(item.Company, item.Employee, item.Document.FileName)
Ответ
HTTP-статус: 200
{
"result": {
"company": "acme-hr",
"employee": "EMP-001",
"document": {
"date": "2026-08-07T10:15:30+03:00",
"name": "Трудовой договор",
"fileUrl": "https://test.bitrix24.ru/rest/download.json?auth=***&token=sign.b2e...",
"fileName": "Трудовой договор.pdf",
"uid": "TD-2026-001",
"documentUid": "R-LK-50JI-3AAK-WS1A"
}
},
"time": {
"start": 1786086930.123,
"finish": 1786086930.456,
"duration": 0.333,
"processing": 0.111,
"date_start": "2026-08-07T10:15:30+03:00",
"date_finish": "2026-08-07T10:15:30+03:00",
"operating_reset_at": 1786087530,
"operating": 0
}
}
Возвращаемые данные
result
object
Информация о подписанном документе (подробное описание)
time
time
Информация о времени выполнения запроса
Обработка ошибок
HTTP-статус: 200
{
"error": "SIGN_HCMLINK_DOCUMENT_NOT_FOUND",
"error_description": "Document not found"
}
| Код | Описание | Значение |
|---|---|---|
403 |
ACCESS_DENIED |
Access denied |
403 |
WRONG_AUTH_TYPE |
Current authorization type is denied for this method |
200 |
Пустое значение | Module humanresources is not available |
200 |
SIGN_HCMLINK_DOCUMENT_NOT_FOUND |
Document not found |
200 |
SIGN_HCMLINK_DOCUMENT_NOT_LINKED |
No employee or company linked to the document |
200 |
SIGN_HCMLINK_NO_SIGNED_FILE_EXIST |
Signed file for this document does not exist |

