- Where a method has a v3 form, prefer the explicit
actions.v3.*surface — see available v3 methods.
Overview
Use CallV2.make() to call REST API version 2 methods.
The method returns a Promise with an AjaxResult object containing response data, status, and error handling methods.
// Basic usage
import { EnumCrmEntityTypeId } from '@bitrix24/b24jssdk'
const response = await $b24.actions.v2.call.make({
method: 'crm.item.get',
params: {
entityTypeId: EnumCrmEntityTypeId.contact,
id: 123
},
requestId: 'unique-request-id'
})
Method Signature
make<T = unknown>(
options: ActionCallV2
): Promise<AjaxResult<T>>
Parameters
The options object contains the following properties:
Return Value
Promise<AjaxResult<T>> — a promise that resolves to an AjaxResult object.
This object provides:
.getData(): SuccessPayload<T> | undefined— returns the success envelope{ result: T, time?: PayloadTime }, orundefinedwhen the request failed. Check.isSuccessfirst.timeis optional — not every response carries one, and the SDK does not invent it..isSuccess: boolean— flag indicating successful request execution..getErrorMessages(): string[]— array of error messages.
Key Concepts
Error Handling
Always check the result using isSuccess and handle errors:
// @check-ignore: top-level return in error-handling illustration
const response = await $b24.actions.v2.call.make({
method: 'some.method',
params: { /* some_params */ },
requestId: 'unique-request-id'
})
if (!response.isSuccess) {
// Handling error
console.error(new Error(`Error: ${response.getErrorMessages().join('; ')}`))
return
}
// Working with a successful result
const data = response.getData()?.result
Examples
Getting a CRM Company
Long-Running Requests
Heavy non-idempotent methods like crm.documentgenerator.document.add
routinely exceed the default 30-second axios timeout. On a timeout the SDK
retries by default, which can create duplicate entities server-side (see
issue #24).
For any method that creates or persists state, raise the axios timeout and disable retries on transport errors:
import { ApiVersion, ParamsFactory } from '@bitrix24/b24jssdk'
// const $b24 = ...
$b24.getHttpClient(ApiVersion.v2).ajaxClient.defaults.timeout = 120_000
await $b24.setRestrictionManagerParams({
...ParamsFactory.getDefault(),
retryOnNetworkError: false
})
await $b24.actions.v2.call.make({
method: 'crm.documentgenerator.document.add',
params: {/*…*/}
})
See Limiters → Long-Running Requests & Non-idempotent Calls for the full explanation and alternative configurations.
Alternatives and Recommendations
Discovering entity fields
Ask the portal which fields an entity has, what type each one is, and whether it can be filtered, sorted or written — instead of guessing them or downloading the whole OpenAPI document. Also states the v3 camelCase field-name rule.
CallList
Method for quickly retrieving all data from list methods of Bitrix24 REST API version 2.