Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code snippet on how to update a webhook using the MessageMedia Webhooks Node.js SDK.
function updateWebhook(){
var webhookId = "WEBHOOK_ID";
var body = new lib.UpdateWebhookRequest({
"url": "https://myurl.com",
"method": "GET",
"encoding": "FORM_ENCODED",
"events": [
"RECEIVED_SMS"
],
"template": "<id>$mtId</id>, <time_sent>$submittedTimestamp</time_sent>, <time_received>$receivedTimestamp</time_received>, <account_id>$accountId</account_id>, <service_type>$type</service_type>"
});
controller.updateWebhook(webhookId, body, function(error, response, context) {
console.log(response);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment