英文:
Bitrix24 - Webhook how to get data phone in array
问题
可以使用以下代码来获取工作电话或座机电话的数据:
[PHONE] => Array
(
[0] => Array
(
[ID] => 45545
[VALUE_TYPE] => WORK
[VALUE] => +351911111111
[TYPE_ID] => PHONE
)
...
(其它电话数据)
...
[2] => Array
(
[ID] => 45549
[VALUE_TYPE] => HOME
[VALUE] => +351220000000
[TYPE_ID] => PHONE
)
...
(其它电话数据)
...
)
如果你想要获取工作电话的数据,可以使用以下代码:
$work_phone = $result['PHONE'][0]['VALUE'];
如果你想要获取座机电话的数据,可以使用以下代码:
$landline_phone = $result['PHONE'][2]['VALUE'];
希望对你有所帮助。
英文:
In bitrix24 it is possible to create webhooks to obtain contact data. In contacts, the phone field is an array that is made up of several arrays but I don't understand how I can get the data from the work phone or landline phone array.
To get the phone data I use SELECT[] with the PHONE parameter. Can anyone help me with the structure, I've tried PHONE[0] without success.
Thank you in advance
[PHONE] => Array
(
[0] => Array
(
[ID] => 45545
[VALUE_TYPE] => WORK
[VALUE] => +351911111111
[TYPE_ID] => PHONE
)
[1] => Array
(
[ID] => 45547
[VALUE_TYPE] => MOBILE
[VALUE] => +351910000000
[TYPE_ID] => PHONE
)
[2] => Array
(
[ID] => 45549
[VALUE_TYPE] => HOME
[VALUE] => +351220000000
[TYPE_ID] => PHONE
)
[3] => Array
(
[ID] => 45551
[VALUE_TYPE] => FAX
[VALUE] => +351210000000
[TYPE_ID] => PHONE
)
[4] => Array
(
[ID] => 45553
[VALUE_TYPE] => PAGER
[VALUE] => +351230000000
[TYPE_ID] => PHONE
)
[5] => Array
(
[ID] => 45555
[VALUE_TYPE] => MAILING
[VALUE] => +351240000000
[TYPE_ID] => PHONE
)
[6] => Array
(
[ID] => 45557
[VALUE_TYPE] => OTHER
[VALUE] => +351250000000
[TYPE_ID] => PHONE
)
)
答案1
得分: 1
在 JavaScript 部分,我将读取字段值为 "work",而不是在 Webhook 中获取该字段,这样问题就解决了。
英文:
Instead of getting the field in the webhook, on the javascript side I'll read the field value = work and the problem is solved.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论