Skip to content

Instantly share code, notes, and snippets.

@mrlynn

mrlynn/lookupTwilio.js

Last active Apr 20, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.