Bitrix24 - Webhook how to get data phone in array

149 Views Asked by At

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

There are 1 best solutions below

0
user2068739 On

Instead of getting the field in the webhook, on the javascript side I'll read the field value = work and the problem is solved.