G
G
Galdar Turin2020-05-26 17:42:27
Bitrix24
Galdar Turin, 2020-05-26 17:42:27

How to request contact list via REST API?

Request

BX24.callMethod(
        "crm.contact.list", 
        {
          order: {},
          filter: { "*": "*" }
          //select: [ "ID", "PHONE", "NAME", "LAST_NAME", "TYPE_ID", "SOURCE_ID", "SOURCE_DESCRIPTION" ]
        },
        (result: any) =>
        {
          if(result.error())
            console.error(result.error());
          else
          {
            //console.log(result.data());
            if(result.more())
              result.next();						
          }
        }
      );



Answer

ADDRESS: null
ADDRESS_2: null
ADDRESS_CITY: null
ADDRESS_COUNTRY: null
ADDRESS_COUNTRY_CODE: null
ADDRESS_POSTAL_CODE: null
ADDRESS_PROVINCE: null
ADDRESS_REGION: null
ASSIGNED_BY_ID: "1"
BIRTHDATE: ""
COMMENTS: ""
COMPANY_ID: "2"
CREATED_BY_ID: "1"
DATE_CREATE: "2015-11-13T18:19:13+03:00"
DATE_MODIFY: "2015-11-13T18:19:13+03:00"
EXPORT: "Y"
FACE_ID: null
HAS_EMAIL: "Y"
HAS_IMOL: "N"
HAS_PHONE: "Y"
HONORIFIC: "0"
ID: "2"
LAST_NAME: "Худяков"
LEAD_ID: null
MODIFY_BY_ID: "1"
NAME: "Алексей"
OPENED: "Y"
ORIGINATOR_ID: null
ORIGIN_ID: null
ORIGIN_VERSION: null
PHOTO: null
POST: "Системный администратор"
SECOND_NAME: ""
SOURCE_DESCRIPTION: ""
SOURCE_ID: "PARTNER"
TYPE_ID: "1"
UTM_CAMPAIGN: null
UTM_CONTENT: null
UTM_MEDIUM: null
UTM_SOURCE: null
UTM_TERM: null



In CRM, a contact type was added in the directory and assigned to this contact, but a number is given in the TYPE_ID field instead of a custom name.
How to display a list of contact types that is specified in the directory and is also used in the "Contact Type" field?
Screen

5ecd2ab0f3277892552690.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Galdar Turin, 2020-05-27
@Galdar

https://dev.1c-bitrix.ru/rest_help/crm/auxiliary/s...

BX24.callMethod(
        "crm.status.list", 
        {
          order: { },
          filter: { "ENTITY_ID": "CONTACT_TYPE" }
        },
        (typeContact: any) =>
        {
          if(typeContact.error())
            console.error(typeContact.error())
          else
          {
           typeContact.data()
            if(typeContact.more())
              typeContact.next();						
          }
        }
      )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question