Skip to content

Commit e3d20b1

Browse files
committed
Final push to whatsapp backend
1 parent 3702641 commit e3d20b1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

TwilioWhatsAppIntegration/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var express = require('express');
22
var app = express();
33

4-
const accountSid = 'sid';
5-
const authToken = 'token';
4+
const accountSid = 'Account_ID';
5+
const authToken = 'Auth_Token';
66
const client = require('twilio')(accountSid, authToken);
77

88
app.get('/temperature', function (req, res) {
@@ -12,7 +12,7 @@ app.get('/temperature', function (req, res) {
1212

1313
client.messages
1414
.create({
15-
body: 'Tampered!' + req.query.temperature,
15+
body: 'Your package was tampered at ' + req.query.location + ' and the temperature has changed to ' + req.query.temperature + ' Degree Celcius.',
1616
from: 'whatsapp:+14155238886',
1717
to: 'whatsapp:+918289940688'
1818
})
@@ -31,7 +31,7 @@ app.get('/location', function (req, res) {
3131

3232
client.messages
3333
.create({
34-
body: 'Location changed!',
34+
body: 'Your package has arrived at ' + req.query.location + ' with temperature ' + req.query.temperature + ' Degree Celcius.',
3535
from: 'whatsapp:+14155238886',
3636
to: 'whatsapp:+918289940688'
3737
})
@@ -43,7 +43,7 @@ app.get('/location', function (req, res) {
4343
});
4444

4545

46-
pp.get('/destination', function (req, res) {
46+
app.get('/destination', function (req, res) {
4747
console.log('Location Change');
4848
console.log(req.query.temperature)
4949
console.log(req.query.location)

0 commit comments

Comments
 (0)