Force Update Authorization Key BX24.refreshAuth

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

BX24.refreshAuth(someCallback: function): object
        

The BX24.refreshAuth function forcefully updates the authorization key. The handler function someCallback will receive an object similar to BX24.getAuth(). It only works after BX24.init.

Function Parameters

Name
type

Description

someCallback
function

Accepts a function that will be executed upon success

Example

BX24.init(() => {
            const authInfo = BX24.getAuth();
            console.log('BX24: current authInfo: ', authInfo);
        
            const button = document.createElement('button');
            button.textContent = 'Refresh auth';
            button.addEventListener('click', () => {
                BX24.refreshAuth((refreshedAuthInfo) => {
                    console.log('BX24: refreshed authInfo: ', refreshedAuthInfo);
                })
            });
            document.body.appendChild(button);
        });
        

How to Use Examples in Documentation

Continue Learning