0
votes
 await client.messages.create(
            {
                to: `+${userEntity.telephoneNumber}`,
                from: `+${process.env.TWILIO_NUMBER}`,
                body: `Your activation code is ${userEntity.activationCode}`,
            },
            (err, message) => {
                if (err) {
                    throw err
                } else {
                    return this._res.status(200).json({message: message}).end()
                }
            }
        );

Error: The number +xxxxxxx is unverified. Trial accounts cannot send messages to unverified numbers; verify +xxxxxxx at twilio.com/user/account/phone-numbers/verified, or purchase a Twilio number to send messages to unverified numbers.

Hi everyone. I was trying to send a message from Twilio to the user but I've got this error.Who can help me? Maybe I don't understand how does it work. Should I add a number to which I want to send a message to Twilio? Or what does this message mean?

1

1 Answers

1
votes

Yes that is exactly what it means, you have to verify the number you want to send your message to. The verification is done by either a call or a text.
Twilio - Verify Phone number

This will also allow you to use this number as a caller id when making a call(does not work with texting).

This is a somewhat common limitation setup for trial accounts.