Sending Templated Notification
Once you've created the template using your Engagespot dashboard, it can be sent using the send notification API itself.
You just need to specify the templateId
(which you can see on your dashboard), and the key value pairs for the placeholders that you want to be replaced in your template.
- Node
- cURL
const { EngagespotClient } = require('@engagespot/node');
const client = EngagespotClient({
apiKey: 'YOUR_ENGAGESPOT_API_KEY',
apiSecret: 'YOUR_ENGAGESPOT_API_SECRET',
});
client.send({
notification: {
templateId: 483561,
},
recipients: ['<your-users-unique-identifier>'],
});
curl --location --request POST 'https://api.engagespot.co/v3/notifications' \
--header 'X-ENGAGESPOT-API-KEY: YOUR_ENGAGESPOT_API_KEY' \
--header 'X-ENGAGESPOT-API-SECRET: YOUR_ENGAGESPOT_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
{
"notification": {
"templateId": 483561
},
"data":{
"taskId":"T-17394",
"comment":"I will do it"
},
"recipients": [
"<your-users-unique-identifier>"
]
}
}'