I have integrated java script SDK for send SMS. I want to retrieve incoming SMS.
Is there any way to get plain text of message body in mail instead of url of txt file?
I have integrated java script SDK for send SMS. I want to retrieve incoming SMS.
Is there any way to get plain text of message body in mail instead of url of txt file?
// Subscribe for notification
function createSubscription() {
var _eventFilters = [];
_eventFilters.push('/restapi/v1.0/account/~/extension/~/message-store/instant?type=SMS');
return platform.post('/subscription', {
eventFilters: _eventFilters,
deliveryMode: {
transportType: "WebHook",
address: "Your_Webhook_Delivery_Address"
}
})
.then(function(subscriptionResponse) {})
.catch(function(e) { throw e; });
}
// receive notification via webhook and parse the response
app.post('/webhooks', function (req, res) {
req.on('data', function(chunk) {
body.push(chunk);
}).on('end', function() {
body = Buffer.concat(body).toString();
var jsonObj = JSON.parse(body)
var senderNumber = jsonObj['body']['from']['phoneNumber']
var text = jsonObj['body']['subject']
...
});
})
Each sms message you send will have a message id and attachment id with it.
There is an RC API that retrieve the message content in plain text:
/restapi/v1.0/account/~/extension/~/message-store/<message id>/content/<attachment id>
You can use this API in your code
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.