- find your credentials http://ap.bandwidth.com/docs/security/
- Replace from number with a Bandwidth Phone Number on your account
- Any valid media can be passed as array
curl -v -X POST https://api.catapult.inetwork.com/v1/users/{user-id}/messages \
var bw = require('node-bandwidth'); | |
var client = new bw.Client("u-{your_user_id}", "t-{your_token}", "{your_Secret}"); | |
var Promise = require('bluebird'); | |
var PhoneNumber = Promise.promisifyAll(bw.PhoneNumber); | |
var Message = Promise.promisifyAll(bw.Message); | |
var burritoNumber = '+1888222'; | |
var sendMessage = function (message) { | |
console.log("Ordering Burrito"); |
{ '+19192991705': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/hdKsVNAJv9t9u4YMXRc6FmXx' } | |
{ '+17026230824': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/Jteh8gLBfPj5MvPc97d2Esy8' } | |
{ '+19192991710': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/TRGdbjoRYTiRDd7ZG4ASbsE1' } | |
{ '+12056247316': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/EvL6Qnncw82HAMCA4nbwbJCf' } | |
{ '+19193716193': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/cxAinrNxLd6KrRuqyBgKoguq' } | |
{ '+19196702511': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/c8Q5wMbXuk4z7nWEHtMhCY32' } | |
{ '+19192991715': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/s7TnrTibxS5SrCJj4odGaNt1' } | |
{ '+14154624756': 'Chipotle: Almost there. Click here for your free burrito: https://rainchec |
[ | |
{ '+19192991705': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/hdKsVNAJv9t9u4YMXRc6FmXx' }, | |
{ '+17026230824': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/Jteh8gLBfPj5MvPc97d2Esy8' }, | |
{ '+19192991710': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/TRGdbjoRYTiRDd7ZG4ASbsE1' }, | |
{ '+12056247316': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/EvL6Qnncw82HAMCA4nbwbJCf' }, | |
{ '+19193716193': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/cxAinrNxLd6KrRuqyBgKoguq' }, | |
{ '+19196702511': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/c8Q5wMbXuk4z7nWEHtMhCY32' }, | |
{ '+19192991715': 'Chipotle: Almost there. Click here for your free burrito: https://raincheck.hit2c.com/s7TnrTibxS5SrCJj4odGaNt1' }, | |
{ '+14154624756': 'Chipotle: Almost there. Click here for your free burrito: https:/ |
// find your credentials http://ap.bandwidth.com/docs/security/ | |
curl -v -X GET https://api.catapult.inetwork.com/v1/availableNumbers/local?areaCode=818 \ | |
-u {YOUR_TOKEN}:{YOUR_SECRET} \ | |
-H "Content-type: application/json" | |
//Fill in the number below with the number found above!! | |
curl -v -X POST https://api.catapult.inetwork.com/v1/users/{YOUR_USER_ID}/phoneNumbers \ | |
-u {YOUR_TOKEN}:{YOUR_SECRET} \ | |
-H "Content-type: application/json" \ |
[ | |
{ "+14155989166": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/o0Du8W. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" }, | |
{ "+19192991704": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/Y06uIW. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" }, | |
{ "+14154292562": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/W0Xu1W. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" }, | |
{ "+19194390814": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/j0QuNW. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" }, | |
{ "+14154651445": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/I06uDW. Expires 2/25. Reply FOIL to sign up for offers & alerts. Msg freq varies. Msg&data may apply" }, | |
{ "+14156128136": "Chipotle: Here it is. Ur free burrito. http://vbs.cm/30CuqY. Expires 2/25. Reply FOIL to sign up for offers & alerts. |
app.get('/callcallback', function (req, res) { | |
var response = new xml.Response(); | |
var playAudio = new xml.PlayAudio({ | |
url: 'https://s3.amazonaws.com/bwdemos/vday/vday.mp3' | |
}); | |
var hangup = new xml.Hangup(); | |
response.push(playAudio); | |
response.push(hangup); | |
res.send(response.toXml()); | |
}); |
app.get('/msgcallback', function(req, res) { | |
var response = { | |
to: req.query.from, | |
from: req.query.to, | |
text: getPhrase() | |
}; | |
var text = req.query.text.toLowerCase(); | |
switch(text) { | |
case 'i luv u': | |
response.media = [getPhoto()]; |
r = requests.get('https://api.github.com/events') | |
print(r.text) | |
r = requests.get('https://api.catapult.inetwork.com/v1/availableNumbers/local?areaCode=919', auth=('{your_token}', '{your_secret')) | |
r = requests.get('https://api.catapult.inetwork.com/v1/availableNumbers/local?areaCode=919', | |
auth=('{your_token}', '{your_secret')) | |
print(r.text) |
curl -v -X POST https://api.catapult.inetwork.com/v1/users/{user-id}/messages \
Object