JavaScript
Create a local server using an ExpressJS application.
To use an ExpressJS application:
Create a new application using
npm init.Install the ExpressJS library by using
npm install express --saveWrite the code:
const express = require('express') const app = express() const port = 3000 app.post('/webhook', function(req, res, next) { console.log(req.body) res.send(200) }); app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))To start your application, run the following command:
node app.js
Your application will now print the events to the console when a call is made or received.
Note: Make sure the port you have specified (300) is the same port you use when creating your ngrok URL.
Log incoming calls to Salesforce
Logging incoming calls into Salesforce
Available on:
Steps
1
Introduction to this task2
Prerequisites3
Create a webhook4
Express app for webhook5
Update Express app to make API calls to Salesforce6
What's next?