How do I get detailed company information from bitrix24 using the Rest API

79 Views Asked by At

I would like to synchronize locally stored company data with our data from bitrix24, using a webhook and the Rest API methods.

When using crm.company.list, I get the list with some information, but for example all the address fields are empty. Same when using crm.company.get?id=xy. When I log into the account and export the companies as CSV, the file contains various address fields with the correct values and other detailed company data, as well as an information Id, but I can't figure out how to use this information Id or get the same company data with the REST API.

2

There are 2 best solutions below

0
Yuvraj Hinger On

Just a heads up, the Bitrix Company Detail API doesn't give all related entity info in one call. For addresses and phones, you'll need to make extra API calls. To get addresses, try crm.address.list. Check out the docs: Bitrix CRM Address List Documentation

0
Roman On

There are several address types in Bitrix24:

  • Delivery address
  • Street address
  • Legal address
  • Registered address
  • Beneficiary address

Empty address fields present in crm.company.get request responsible for Delivery address type.

To get address fields data for other address types, you have to do two calls. First - list all requisites for given company. Example:

BX24.callMethod(
    "crm.requisite.list",
    {
        filter: {
            "ENTITY_ID": 20235, /* company id */
            "ENTITY_TYPE_ID": 4 /* entity type id for company */
        }
    }
);

And for second call get addresses entity id from response and make the request:

BX24.callMethod(
    "crm.address.list",
    {
        filter: { "ENTITY_ID": 50677 } /* address entity id */
    }
);