Views: 4278
Last Modified: 17.08.2020

Let's review standard Push & Pull client within an application. Here's an example of app page with web interface:

<!DOCTYPE html>
	<title>Bitri24 application with Push & Pull</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<script src="//"></script>
	<script src="//"></script>
		window.appPullClient = new BX.PullClient({
			restApplication: '',
			restClient: BX24,
			userId: 1

			moduleId: 'application',
			callback: function (data) {
				console.warn(data); // {command: '...', params: {...}, extra: {...}}

Indicate the following parameters when initializing BX.PullClient:

  • restApplication - indicate arbitrary app's string identifier. (Can be unique for each portal with your application installed)
  • userId - indicate currently authorized user ID

Connecting PullClient allows for your app's front-end to receive an event from your app's back-end channel via при помощи метода pull.application.event.add.

Courses developed by Bitrix24