W
W
webmaster22017-04-21 15:34:47
1C-Bitrix
webmaster2, 2017-04-21 15:34:47

Why is the phone not added to the lead in Bitrix24?

Using the rest api, I'm trying to add a lead to Bitrix 24.
I form the call like this:
$url = 'https: //domain.bitrix24.ru/rest/crm.lead.add.json?fields[TITLE]=Callback&fields[PHONE]=' .$tel.'&fields[NAME]='.$name.'&auth=***;
The lead is successfully added, but there is no phone number. I also tried to write fields[PHONE_WORK], fields[PHONE_HOME] but that didn't help. How to make a call?
Thanks in advance

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Super0leg, 2018-12-06
@webartisan2

Although it is no longer relevant, it will help those who are faced with the same problem:
the field should still be called "PHONE"
Example from the documentation:

BX24.callMethod(
  "crm.lead.add", 
  {
    fields:
    { 
      "TITLE": "ИП Титов", 
      "NAME": "Глеб", 
      "SECOND_NAME": "Егорович", 
      "LAST_NAME": "Титов", 
      "STATUS_ID": "NEW", 
      "OPENED": "Y", 
      "ASSIGNED_BY_ID": 1, 
      "CURRENCY_ID": "USD", 
      "OPPORTUNITY": 12500,
      "PHONE": [ { "VALUE": "555888", "VALUE_TYPE": "WORK" } ] 
    },
    params: { "REGISTER_SONET_EVENT": "Y" }
  }, 
  function(result) 
  {
    if(result.error())
      console.error(result.error());
    else
      console.info("Создан лид с ID " + result.data());
  }
);

note that the phone fields are nested in a 2-level array

G
gelkin, 2017-07-07
@gelkin

I have the same problem! Also with the EMAIL and Skype fields. Did you manage to solve it?

M
Mikhail Stolpovskikh, 2017-07-10
@monkeysbrain

the field should not be called PHONE, but PHONE_WORK
https://dev.1c-bitrix.ru/community/blogs/chaos/crm...

M
m_pakmen, 2020-06-13
@m_pakmen

From 2020 the same trouble with PHONE how to solve ?? This method didn't work

O
Oleg, 2020-11-01
@Oleg714

'PHONE' => array(
array(
"VALUE" => "Phone number",
"VALUE_TYPE" => "WORK"
)
)
Here is a working example

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question