yarbshk / pybitrix24

The simplest zero dependency polyversion Python library for Bitrix24 REST API.
MIT License
43 stars 23 forks source link

ERROR_METHOD_NOT_FOUND in bx24.call_batch #1

Closed maglor closed 7 years ago

maglor commented 7 years ago

Hello! Batch call from example gives error:

>>> bx24.call_batch({
...    'get_user': ['user.current', {}],
...    'get_department': {
...        'method': 'department.get',
...        'params': {'ID': '$result[get_user][UF_DEPARTMENT]'}
...    }
... })
{'result': {'result': [], 'result_error': {'get_user': {'error': 'ERROR_METHOD_NOT_FOUND', 'error_description': 'Method not found!'}, 'get_department': {'error': 'ERROR_METHOD_NOT_FOUND', 'error_description': 'Method not found!'}}, 'result_total': [], 'result_next': []}}
yarbshk commented 7 years ago

Hi @maglor! Yes, it is! The call_batch method doesn't work properly now (unfortunatelly). I think it's probably a Bitrix24-side bug (referensing to this old topic). To make it clear I sent a bug request into the support center of Bitrix24 a few days ago (tech-supports of the center reply so slow for owners of a free account). We are trying to resolve this issue now. Follow this issue to keep in touch pro tempore. Thanks!

maglor commented 7 years ago

@yarbshk Thanks! I'm B24 partner, I'll try to ask support about this bug too, if you provide a ticket number. May be they will reply a little bit faster :-)

yarbshk commented 7 years ago

@maglor nice to hear you! Yep, sounds good) The ticket number is №1616327. Hope we resolve this issue a little bit faster. Thanks for indifference! Where can I follow about a work progress? How could I help?

maglor commented 7 years ago

Там вызов делается не к batch, а без указания этого метода, поэтому и проблема. в примере не указан ключ auth с токеном авторизации.

Корректный вызов: /rest/batch.json?cmd[get_user]=user.current?&cmd[get_department]=department.get?ID=%24result%5Bget_user%5D%5BUF_DEPARTMENT%5D

yarbshk commented 7 years ago

@maglor thanks, but it's not a reason of the broken call_method method. The structure of API call was not quite right. This article give me better understanding of the topic. Fix this issue in the 3b22beab47c98b216966a384768b7124eae6faad commit. Thanks a lot for your contribution! Close this issue.