Skip to content

Instantly share code, notes, and snippets.

@IbrahimTareq
Last active May 24, 2018 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IbrahimTareq/75182fceb139a479c41bc5a5c1365873 to your computer and use it in GitHub Desktop.
Save IbrahimTareq/75182fceb139a479c41bc5a5c1365873 to your computer and use it in GitHub Desktop.
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