Skip to content

Send Notification from a Push Template

Method

POST

URL

https://api.backendless.com/<application-id>/<REST-api-key>/messaging/push/<template-name>

where:

Argument                Description
<application-id> the ID of your application generated upon its creation. You can get the value in the Manage > App Settings section of the Backendless Console.
<REST-api-key> REST API key of your application. You can get the value from the Manage > App Settings section of the Backendless Console.
<template-name> name of the push template from which push notification will be created by the server.

Request Headers

Content-Type: application/json  
user-token: optional value obtained as a result of the login operation.

where:

Argument                Description
Content-Type Must be set to application/json. This header is mandatory.
user-token Optional header. Contains a value returned by Backendless in a preceding user Login API call. If user-token is set in the request, the operation will be executed with the security policy associated with the currently logged in user. This means all permissions associated with the user and the roles assigned to the user will be enforced by Backendless.

Request Body:

Optional parameters are shown in [square brackets]:

{  
  "templateValues" :   
  {  
     "smartTextVar1" : "value",  
     "smartTextVar2" : "value"  
  }  
}

where:

Argument                Description
smartTextVar1,2,etc is a name of a custom smart text variable used in the template.

If the template does not have any custom smart text variables, the templateValues element in the request body is optional.

Backendless Console includes a code generator which creates the client-side code for publishing a push notification for a template. To access the code generator, login to Backendless Console, select your app and click the Messaging icon. Select the PUSH NOTIFICATION tab and click the Push Templates menu. There is the "show code" icon for each created template as shown below. When you click the icon, a popup is displayed with the generated code:

generate-code-push-template.zoom70

The displayed popup lets you select the client-side language and copy the generated code:
push-template-generated-code