Phone Number Verification issue

Hi Backendless Team,
My intended scenario is that already registered user will be asked to add and confirm his phone number to access additional features in app. I might not fully understand why am I unable to get verification code from Twilio.
Error i am getting is: “Twilio.sendVerificationCode” method is allowed from BusinessLogic only.

App ID: F001F3BF-4CCD-B35E-FFD0-23845DEE6000
page: validate-phone-number
I’m trying to send code on frontend, when the user enters his phone number and clicks the button:

You must create an API Service that will call the Twilio method, and after that use this API service in your front-end logic.

Here you could find information about Codeless Bussines Logic - API Services Overview - Backendless Codeless Development Guide

Regards, Dima.

@Dima I am a bit lost. Isn’t that what’s been created: Twilio API service, when we install Twilio plugin?

You install a Twilio service. This service contains “Public” and “Private” methods. Public methods could be used anywhere as is. But Private methods require a Cloud Code API key in their invocation context, so if you want to use this method, you should create your own API service that will call this Private method.

Ok, that starts to get clearer. Do you know, maybe there is some example is some of Mark’s videos?

Hello @Uldis_Borkus

Unfortunately, we don’t have any videos like this.

Regards,
Inna

Got it, I’ll try yo resolve later today as per my understanding, if anything will continue the topic.

Hi @Dima Looks like understood the concept.
But now I have strange issue.

  1. Created new API Service, and created logic for it:

initially I was getting 21211 error message about invalid phone number. That was resolved by using trial number from twilio.
After that I upgraded my twilio account, and now I have my phone number and trial number assigned with twilio.

  1. But now I am getting error: Configure “Twilio Sender Phone Number”.
    But when I view Service Configuration for Twilio, it erases previously added Account SID, Auth Token, Twilio Sender Phone Number.
  • And this repeats itself > I add those values from my Twilio dashboard,
  • When I press Test Configuration it says Test Passed,
  • Then I press Save all seems ok,
  • but if I open the Configuration, it erases thoses values.
    -Same if I try to Invoke, then it throws the error that I havent configured sender number.

Resolved:
After refreshing screens, the gear icon went inactive for configuring Twilio. Decided to Uninstall, and Install it again. This worked - Configuration is possible to save and logic mentioned above is working.