Calling Methods with Confirmation

Some methods to be called require confirmation of an account administrator. When an app calls such method, an account administrator receives notification with the option to permit or deny the call, and the app will receive an error.

Attention! The permission or denial are given to specific authorization token, with which the method call is performed. That is, the permission is valid until the token is valid - when a next token is received, a new permission is required.

HTTP/1.1 401 Unauthorized

    "error_description": "Waiting for confirmation"

If the method is called prior the confirmation or a response, it will return the same response, but without the request for repeated confirmation.

When receiving the permission or denial by the administrator, the event OnAppMethodConfirm handler will be called. It receives the confirmation result as well as a token, via which this permission was issued:

array (
  'data' => 
  array (
    'TOKEN' => 'fkp963yuv1ggkfbs5z3f5hy8lilm0iw6',
    'METHOD' => 'voximplant.user.get',
    'CONFIRMED' => '1',
    'LANGUAGE_ID' => 'en',
  'ts' => '1478790852',
  'auth' => 
  array (
    'domain' => '',
    'client_endpoint' => '',
    'server_andpoint' => '',
    'member_id' => '74ef8a46a75104de55d5d4a61b98ab6d',
    'application_token' => 'c289487163b58658eae5e8b42eaf11b8',

If the administrator has permitted the action, application can use the same authorization token for the work with the requested method:

HTTP/1.1 200 OK

    "result": [
            "DEFAULT_LINE": null, 
            "ID": "1", 
            "INNER_NUMBER": null, 
            "PHONE_ENABLED": "Y", 
            "SIP_LOGIN": "****", 
            "SIP_PASSWORD": "*****", 
            "SIP_SERVER": "*****"

In case of a denial, the following error will return:

HTTP/1.1 403 Forbidden

    "error": "METHOD_CONFIRM_DENIED", 
    "error_description": "Method call denied"

List of methods, requiring confirmation can be found here:

© «Bitrix24», 2001-2022