kpadams
kpadams

Reputation: 11

Twilio Name Look-up for SMS

For incoming SMS messages I'd like to be able to match the senders cell phone number with the numbers owners name. Is anyone doing this using Twilio? They have an option for voice calls but not one for SMS. Thanks.

Upvotes: 1

Views: 85

Answers (1)

Hunter
Hunter

Reputation: 416

In the twilio lookup api. https://www.twilio.com/docs/api/lookups

// Download the Node helper library from twilio.com/docs/node/install
// These are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';

const client = require('twilio')(accountSid, authToken);

client.lookups.v1
  .phoneNumbers('+16502530000')
  .fetch({type: 'caller-name'})
  .then((number) => console.log(number.carrier.type, number.carrier.name));

You want to retrieve the callername, this depends on whether you are using nodejs or not, but other examples are posted.

Upvotes: 1

Related Questions