Tag conditions
Each tag condition is an array like [tagName, operator, operand]
where
- tagName: name of a tag
- operator: "EQ" | "IN" | "NOTEQ" | "NOTIN" | "LTE" | "GTE" | "BETWEEN"
- operand: string | integer | array | date
Operand description
- EQ: tag value is equal to operand;
- IN: tag value intersects with operand (operand must always be an array);
- NOTEQ: tag value is not equal to an operand;
- NOTIN: tag value does not intersect with operand (operand must always be an array);
- GTE: tag value is greater than or equal to operand;
- LTE: tag value is less than or equal to operand;
- BETWEEN: tag value is greater than or equal to min operand value but less than or equal to max operand value (operand must always be an array).
String tags
Valid operators: EQ, IN, NOTEQ, NOTIN
Valid operands:
- EQ, NOTEQ: operand must be a string;
- IN, NOTIN: operand must be an array of strings like
["value 1", "value 2", "value N"]
;
Integer tags
Valid operators: EQ, IN, NOTEQ, NOTIN, BETWEEN, GTE, LTE
Valid operands:
- EQ, NOTEQ, GTE, LTE: operand must be an integer;
- IN, NOTIN: operand must be an array of integers like
[value 1, value 2, value N]
; - BETWEEN: operand must be an array of integers like
[min_value, max_value]
.
Date tags
Valid operators: EQ, IN, NOTEQ, NOTIN, BETWEEN, GTE, LTE
Valid operands:
"YYYY-MM-DD 00:00"
(string)- unix timestamp
1234567890
(integer) "N days ago"
(string) for operators EQ, BETWEEN, GTE, LTE
Boolean tags
Valid operators: EQ
Valid operands: 0, 1, true, false
List tags
Valid operators: IN
Valid operands: operand must be an array of strings like ["value 1", "value 2", "value N"]
.
Remember that “filter” and “conditions” parameters should not be used together.
Also, both of them will be ignored, if the "devices" parameter is used in the same request.
Country and Language tags
Language tag value is a lowercase two-letter code according to ISO-639-1
Country tag value is an UPPERCASE two-letter code according to ISO_3166-2
For example, to send push a notification to Portuguese-speaking subscribers in Brazil, you will need to specify the following condition:"conditions": [["Country", "EQ", "BR"],["Language", "EQ", "pt"]]