MongoDB Stitch Function to Lookup a number using Twilio's lookup API
exports = function(phoneNumber){ | |
const host = "lookups.twilio.com"; | |
const path = `/v1/PhoneNumbers/${phoneNumber}`; | |
const lookupUrl = `https://lookups.twilio.com/v1/PhoneNumbers/${phoneNumber}`; | |
const http = context.services.get("http"); | |
const { SID, Secret } = context.values.get("twilioCredentials"); | |
return http.get({ | |
"scheme": "https", | |
host, | |
path, | |
"username": SID, | |
"password": Secret | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment