I'm trying to configure sending a push notification to a template (via the API) such that the subscribers will receive the push notifications at the specified local_scheduled _time. As a first step, I've successfully set up sending push notifications (immeadiate send) via api/templates/push with such a payload (I've stubbed in dummy data):
{
"device_types":["ios","android"],
"audience":{"tag":"test_audience","group":"test"},
"merge_data":{
"template_id":"3d6ecd76-45b9-4de1-b3ac-686cd470a0f3",
"substitutions":{"publication":"Test Publication","article_id":"test.v74.n3.7"}}
}
When I tried to extend this to send such a push notification by a specified time (local_scheduled_time) by adding the schedule object I've encountered problems with the compatibility of payloads. Take the following request payload sent to api/schedules endpoint:
{
"schedule": {
"local_scheduled_time": "2018-10-05T11:25:00"
},
"push": {
"device_types":["ios","android"],
"audience":{"tag":"test_audience","group":"test"},
"merge_data":{
"template_id":"3d6ecd76-45b9-4de1-b3ac-686cd470a0f3",
"substitutions":{"publication":"Test Publication","article_id":"test.v74.n3.7"}}
}
}
This resulted in an error message: "The key 'merge_data' is not allowed in this context"
Then, when I attempted the same push to api/templates/push, I received the error message "The key 'schedule' is not allowed in this context"
Considering the errors I've encountered: Is it possible to do this - to send templated push notifications but on a specified time? If so, how can I accomplish this?
Comments
2 comments