Closed FedericoTartarini closed 3 years ago
I have implemented this by specifying some filters when I send the notification with Python. More information here. Sample code below:
import requests
import json
header = {"Content-Type": "application/json; charset=utf-8",
"Authorization": "Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
payload = {"app_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"filters": [
{"field": "country", "relation": "=", "value": "SG"},
{"operator": "AND"}, {"field": "app_version", "relation": "=", "value": "15"}
],
"included_segments": ["All"],
"contents": {"en": "Please complete the Cozie survey, app version 15."}}
req = requests.post("https://onesignal.com/api/v1/notifications", headers=header, data=json.dumps(payload))
print(req.status_code, req.reason)
Create notification groups so I can send different reminders to different groups of people