Documentation

pull.application.push.add

Description

Method for sending push notification to a mobile device within Bitrix24 application framework.

Parameters

Parameter Example Required Description
USER_ID 1 or [1,2,3] Yes Push notification recipient user IDs.
TEXT 'Hello, world!' No Arbitrary text.
AVATAR 'https://files.johnsmith.com/images/avatar_smith.jpg' No Image link.

Examples

JavaScript

BX24.callMethod('pull.application.push.add', {
	'USER_ID': [1,2,3],
	'TEXT': 'Hello, world!',
	'AVATAR': 'https://files.shelenkov.com/images/avatar-ivanov.jpg',
}, function(result){
	if(result.error())
	{
		console.error(result.error().ex);
	}
	else
	{
		console.log(result.data());
	}
});

PHP

$result = restCommand('pull.application.push.add', [
	'USER_ID': [1,2,3],
	'TEXT': 'Hello, world!',
	'AVATAR': 'https://files.shelenkov.com/images/avatar-ivanov.jpg',
], $_REQUEST["auth"]);	

Response example

{
    "result": true
}

Example of error response

{
    "error": "WRONG_AUTH_TYPE",
    "error_description": "Send push notifications available only for application authorization."
}

Keys:

  • error - erro key
  • error_description - brief error description

Possible error codes

Code Description
TEXT_ERROR Message text not passed.
EMPTY_APP_NAME Error occurs when your application doesn't have a name.
ACCESS_ERROR Method can be used only by user with administrator rights.
WRONG_AUTH_TYPE Method can be used only within OAuth 2.0.

See Also



User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix Inc.», 2001-2021, «Bitrix Inc.», 2021