B
B
Brepex2022-04-07 11:56:32
PHP
Brepex, 2022-04-07 11:56:32

How to authorize an application in Bitrix through $_REQUEST parameters?

Good day, fellow programmers, I need help with the BITRIX application. I am working on one application in order to release it to the market in the future, but the problem is that I do not know how to authorize the account that a person will use. The JS library is not an option to use, since the placement.bind method can be said to be not working, as I understand it. This can only be done via php.

The question is, if implemented through php, there, as far as I know, you need to enter such a thing

define('C_REST_CLIENT_ID','local.5c8bb1b0891cf2.8725');//Application ID
define('C_REST_CLIENT_SECRET','SakeVG5mbRdcQet45UUrt6q72AMTo7fkwXSO7Y5LYFYNCR');//Application key
// or
define('C_REST_WEB_HOOK_URL','https://rest-api.bitrix24.com/rest/1/doutwqkjxgc3mgc1/');//url on creat Webhook


And the problem is that if you enter it, there will immediately be authorization for only one account, as I understand it, for example, it will display my leads through the crm.lead.list method, and not the leads of the person who installed the application. And here's how to make sure that the application authorizes exactly the user who installed it, which would display his leads, I looked in $ _REQUEST there are many different interesting parameters through which, as I understand it, you can log in, but did not find information how. And how can this be done? That's just the question, I hope you understand what I mean)))

And yet, tell me, please, what should be entered in the HANDLER parameter,
The URL of the embed location handler. Required.
This is described in the rest bitrix, I didn’t understand much

CRest::call(
   'placement.bind',
   [
      'PLACEMENT' => 'PLACEMENT_CODE',
      'HANDLER' => 'https://example.com/place.php',
      'LANG_ALL' => [
         'en' => [
            'TITLE' => 'title',
            'DESCRIPTION' => 'description',
            'GROUP_NAME' => 'group',
         ],
         'ru' => [
            'TITLE' => 'заголовок',
            'DESCRIPTION' => 'описание',
            'GROUP_NAME' => 'группа',
         ],
      ],
   ]
);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question