Close mobile menu
HomeProgrammable SMSProgrammable VoiceText To SpeechVerifyConversationsBetaNumbersBetaLookupMMSHLRReportingBetaBalanceContactsGroups

Verify a Token

In this Verify API Quickstart, we’ll show you how to verify your first token from your web application using MessageBird’s Verify API.

Step 1: Send a verification token

Did you complete the Verify Quickstart: Send a Verification Token?

  • No! It's a prerequisite, so make sure to do so before continuing.
  • Yes! Great, go to step 2.

Step 2: Verify your first token

Enter your credentials and mobile number - as both the

originator
and
recipient
- to the snippet below and copy it to your terminal. Now, hit enter!

$ curl -X GET https://rest.messagebird.com/verify/4e213b01155d1e35a9d9571v00162985?token=123456 \
-H 'Authorization: AccessKey YOUR-API-KEY'

Note: You can access and manage your credentials in the Developer dashboard.

Good job! You've programmatically verified your first token using MessageBird’s Verify API!

Step 3: View the response

Now, let’s view MessageBird’s HTTP response to your API call. If the set up was correct, you'll receive a response similar to this:

{
id: "4e213b01155d1e35a9d9571v00162985",
href: "https://rest.messagebird.com/verify/4e213b01155d1e35a9d9571v00162985",
recipient: 31612345678,
reference: null,
messages: {
href: "https://rest.messagebird.com/messages/31bce2a1155d1f7c1db9df6b32167259"
},
status: "verified",
createdDatetime: "2016-05-03T18:12:54+00:00"
validUntilDatetime: "2016-05-03T18:13:24+00:00"
}

If something went wrong, you’ll receive an error response from the MessageBird API. Don't worry, simply head over to Verify API Troubleshooting to understand the error.

Congrats! You can now programmatically verify a token with MessageBird's Verify API using cURL.

Next steps

You may now want to check out these resources:

Questions?

We’re always happy to help with code or other questions you might have! Check out our API Reference, Developer tutorials or contact support.

Cookie Settings