From 3ade21e05e9b99c5d401f32f748812de4d7acf7e Mon Sep 17 00:00:00 2001 From: psobhanlo Date: Sat, 1 Aug 2020 00:48:13 +0430 Subject: [PATCH] create transactional notification --- nodejs/send-fast-transactional-notification | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nodejs/send-fast-transactional-notification diff --git a/nodejs/send-fast-transactional-notification b/nodejs/send-fast-transactional-notification new file mode 100644 index 0000000..ca1fea4 --- /dev/null +++ b/nodejs/send-fast-transactional-notification @@ -0,0 +1,23 @@ +const pusheToken = "XXXXXXX"; +const pusheUrl = `https://api.pushe.co/v2/messaging/rapid/`; + +let options = { + headers: { + 'Authorization': 'Token ' +pusheToken, + 'Content-Type': 'application/json' + } + }; + + let req = { + app_id: 'XXXX', + data: { + title: "title", + content: "content". + }, + device_id: [device_id , device_id , device_id] + }; + + axios.post(pusheUrl, req, options) + .then(({data}) => console.log(data)) + .catch(err => console.error(err)); +