Skip to main content

Bitrix24 API

Project description

API client for Bitrix24

Low-level API client with multiple strategies for lists gathering. All methods support retries.

Regular call (any method)

from b24api import SyncBitrix24

b24 = SyncBitrix24()
result = b24.call({"method": "user.access", "parameters": {"ACCESS": ["G2", "AU"]}})
print(result)

or the same with async

from b24api import AsyncBitrix24

b24 = AsyncBitrix24()
result = await b24.call({"method": "user.access", "parameters": {"ACCESS": ["G2", "AU"]}})
print(result)

Batch call (any method, no limit)

from b24api import SyncBitrix24

b24 = SyncBitrix24()

requests = ({"method": "user.update", "parameters": {"ID": u, "UF_SKYPE": ""}} for u in range(1000))
result = b24.batch(requests)
print(result)

Gathering full list (slow)

Applicable to list methods with start=<offset> support. Fetches list chunks one by one.

from b24api import SyncBitrix24

b24 = SyncBitrix24()
result = b24.list_sequential({"method": "user.get"})
print(list(result))

Gathering full list (faster)

Applicable to list methods with start=<offset> support. Fetches first list chunk with regular call, then fetches other chunks with batch. Approximately 3 times faster then list_sequential.

from b24api import SyncBitrix24

b24 = SyncBitrix24()
result = b24.list_batched({"method": "user.get"})
print(list(result))

Gathering full list (fastest)

Applicable to list methods with filter={<parameters>} support. Fetches first and last list chunk with batch call, then fetches other chunks with batch. Doesn't use counting (start=-1). Approximately 2 times faster then list_batched.

from b24api import SyncBitrix24

b24 = SyncBitrix24()
result = b24.list_batched_no_count({"method": "user.get"})
print(list(result))

Gathering full list with required reference

Applicable to list methods with select=[<fields>] and filter={<parameters>} support and required filter parameters. Fetches first and last list chunk with batch call, then fetches other chunks with batch. Doesn't use counting (start=-1).

from b24api import SyncBitrix24

b24 = SyncBitrix24()
deal_ids = [1, 2, 3]  # deals IDs (e.g. from "crm.deal.list" call)
filter_updates = ({"=ENTITY_ID": i} for i in deal_ids)
result = b24.reference_batched_no_count(
    {"method": "crm.timeline.comment.list", "parameters": {"ENTITY_TYPE": "deal"}},
    filter_updates,
)
print(list(result))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

b24api-0.7.3.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

b24api-0.7.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file b24api-0.7.3.tar.gz.

File metadata

  • Download URL: b24api-0.7.3.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for b24api-0.7.3.tar.gz
Algorithm Hash digest
SHA256 4a6c3045278684d31b0196df25553f19749b51bd487806a5d28f8c64d03feb29
MD5 1ac07ec002ddb43f94e25b8487c62b0a
BLAKE2b-256 deb2d4f5d18fd89c0a67966d7b0f0a2b9aa9fc6cfee4c262a32dfa06f88a4b7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for b24api-0.7.3.tar.gz:

Publisher: publish-to-pypi.yml on shkarupa-alex/b24api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file b24api-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: b24api-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for b24api-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 313d01168ca3f5fd8277cd040d9a58dcbbb5d9d5a8e1bca9a6afb13aaf83afad
MD5 5b6e97c873723c6fc2cb33a836ef8310
BLAKE2b-256 ba0f9f1d785ab0b3020791401a2b81e21918c81b5c3aee48f9aec4c2d1412fa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for b24api-0.7.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on shkarupa-alex/b24api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page