A
A
AlexMikhailov2019-11-12 11:45:40
1C-Bitrix
AlexMikhailov, 2019-11-12 11:45:40

How to pass variables using webhook?

Good afternoon!
Task: Transfer information from the infoblock to Bitrix24 after it has been added.
Solution: After the event of adding to the infoblock is triggered, I check which infoblock the infa fell into, if it is in the one of interest, we start the process (hereinafter the code)

$arOrder = Array("CREATED"=>"DESC");
          $arSelect = Array('IBLOCK_ID','ID','PROPERTY_USER_NAME','NAME','PROPERTY_MESSAGE','PROPERTY_USER_PHONE');
          $arFilter = Array($arFields["IBLOCK_ID"]);
          $res = CIBlockElement::GetList($arOrder, $arFilter, false, Array("nPageSize"=>1), $arSelect);
          while($ob = $res->GetNext())
          {
 					$arRes[]=$ob;
          }

          $queryUrl = $huck_url[$arFields["IBLOCK_ID"]];
          $queryData = http_build_query(array(
          'fields' => array(
          "TITLE" => $arRes[0]["NAME"],
          "FIRST_NAME" => $arRes[0]["PROPERTY_USER_NAME_VALUE"],
          "STATUS_ID" => "NEW",
          "OPENED" => "Y",
          "SOURCE_ID" => "WEB",
          "ASSIGNED_BY_ID" => 120,
          "PHONE" => $arRes[0]["PROPERTY_USER_PHONE_VALUE"],
          "EMAIL" => $arRes[0]["PROPERTY_USER_EMAIL_VALUE"],
          "COMMENTS" => $arRes[0]["PROPERTY_MESSAGE_VALUE"]["TEXT"],
          ),
          'params' => array("REGISTER_SONET_EVENT" => "Y")
          ));

I do not understand why the data does not fly.
Tell me who can come across?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexMikhailov, 2019-11-12
@AlexMikhailov

"PHONE" => array(array("VALUE" => $ arRes
[0]["PROPERTY_USER_PHONE_VALUE"],"VALUE_TYPE" => "WORK")),
"EMAIL" => array( array("VALUE" => $arRes[0]["PROPERTY_USER_EMAIL_VALUE"],"VALUE_TYPE" => "WORK")),
The problem was in the encoding, fixed it. Everything is working.
Thanks to me!!!!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question