Elmer
Elmer

Reputation: 377

Twilio API - The API for retrieving sent messages returns anonymized phone numbers (+12334XXXX)

I’m new to using the Twilio API, and what I want to do is retrieve all the messages that Twilio has sent to multiple phone numbers via SMS, and then filter out those that have failed with error 21610.

I found this documentation to retrieve that data, but when I tried, I noticed that all the numbers are anonymized in this format: +1234XXXX.

const twilio = require("twilio");

const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listMessage() {
  const messages = await client.messages.list({
    limit: 20
  });

  messages.forEach((m) => console.log(m.body));
}

listMessage();

I’m not using a personal account; I was provided with an account from the company I work for. Does anyone have any idea on how I can get the real numbers? Any suggestions would be greatly appreciated.

Upvotes: 0

Views: 17

Answers (0)

Related Questions