I'm trying to send SMS OTP via MessageBird services with nodejs and flutter application.
I tried the configuration and calls that doing on this video (official from MessageBird) but I cannot understand what is going on with ID that I'm getting back and the token that I should post it to Messagebird's API.
Video link: https://www.youtube.com/watch?v=6wrThyJi7lo
Any one can help me ?
Thank you very much!
In short:
the ID is for the verification process, when you send the ID and the token together back to messagebird in step3 of the tutorial, messagebird will tell you if this token you just sent is the one that was sent to the user.
The flow works like this:
verify
request using messagebird sdk (where it calls messagebird.verify.create(number, {"template": "<message_template>"}...)
%token
from your <message_template>
with a random token and send a message to the user's phone.messagebird.verify.verify(id, token, ...)
more details: you need the ID and the token in order to be able to handle multiple users at the same time, think if u have two users verifying their phone number at the same time, one got token 1234
and the other got 5678
without an ID there's no way to tell them apart.