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:
- your application gets a phone number from the user
- your application makes a
verify
request using messagebird sdk (where it calls messagebird.verify.create(number, {"template": "<message_template>"}...)
- Messagebird will replace
%token
from your <message_template>
with a random token and send a message to the user's phone.
- if the verify.create request succeeds, messagebird will give you an ID for this verification process, you'll need that later to verify the token when the user submits it to you
- The user gives you a token and you pass it back along with the ID (from the previous step) to messagebird where you call
messagebird.verify.verify(id, token, ...)
- Messagebird will respond back to your request with either success or error based on whether the token matches what was sent to the user or not.
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.