Skip to content

Publish with Headers

Message headers is a collection of name/value pairs. A subscriber can set a filter expressed as an SQL "where clause" query (called selector) which Backendless uses to determine whether a message should be delivered to the subscriber. When the query matches the published data in message headers, message is delivered to the corresponding subscriber. For more information see the Conditional Delivery section of this guide.

The following example publishes a message with the city : Tokyo header:



Make sure to replace xxxx in the domain name in the sample request below to the one assigned to your application.

curl -H Content-Type:application/json -X POST \  
-d '{"message":"hello world!", "headers":{"city":"Tokyo"}}' \   



The value of the messageId property can be used to obtain the message delivery status.