loading
Preparing LoginRadius developer resources
Mission: Help enterprises accelerate digital transformation with our fully-managed Customer IAM technology.
Skip to main content

Configuring WhatsApp as a Custom SMS Provider

You can use WhatsApp to deliver the messages LoginRadius normally sends by SMS, such as phone verification, OTPs, password reset and other SMS-based communications. You do this by connecting the Meta WhatsApp Cloud API to the Custom Text/SMS Provider in the LoginRadius Admin Console.

You set things up in two places:

  • Meta: create a WhatsApp app, a sender phone number, an access token and an approved message template with a placeholder.
  • LoginRadius: point the Custom Text/SMS Provider at the WhatsApp Cloud API, and manage your message content in SMS Templates as usual.

How It Works

A LoginRadius flow sends an SMS (for example, phone verification or forgot password)
│
▼
LoginRadius renders the SMS template for that flow
"Your verification code is 123456"
│
▼
LoginRadius calls the WhatsApp Cloud API with:
• the recipient's phone number (#receiver#)
• your approved WhatsApp template name
• the rendered SMS text as a variable (#template#)
│
▼
Meta places the text into the template variable {{1}} and delivers it on WhatsApp

WhatsApp only allows businesses to start a conversation with a message template that Meta has approved. LoginRadius doesn't send free text. It sends the template name and the values for the template's variables, and Meta builds the message from your approved template.

In practice, you create one WhatsApp template that contains a variable ({{1}}), and LoginRadius fills that variable with the text of your LoginRadius SMS template.

Part A: Set Up WhatsApp in Meta

Step 1: Create a Meta App with WhatsApp

  1. Go to Meta for Developers and log in. If you aren't registered as a developer yet, follow the prompts to register.
  2. Open My Apps and click Create App.
  3. Enter an app name and your email.
  4. Select the use case Connect with customers through WhatsApp and click Next.
  5. Select your business portfolio, or create one.
  6. Review the details and click Create app.

You're taken to the WhatsApp Quickstart page for your app.

Step 2: Connect a WhatsApp Account and Phone Number

  1. On the Quickstart page, click Start using the API. This opens the API Setup page.
  2. Under API Setup, connect your app to a WhatsApp business (messaging) account: select an existing one or click Create a WhatsApp Business account.
  3. For testing: Meta gives you a free test phone number. Under To, click Manage phone number list and add the phone numbers that should receive test messages. Each number is verified with a code.
  4. For production: add and verify your own business phone number under Production setup on the same page, and complete Meta's business verification.

Step 3: Get an Access Token

LoginRadius needs an access token to send messages through your WhatsApp account. There are two kinds:

TokenWhere to get itHow long it lastsUse it for
Temporary tokenYour app → WhatsApp → API Setup → Generate tokenAbout 24 hoursQuick testing
Permanent token (System User)Meta Business Suite → Business settings → Users → System usersDoesn't expireYour real (production) setup

For testing (temporary token)

  1. Open your app in Meta for Developers and go to WhatsApp → API Setup.
  2. Click Generate token and copy it.

For production (permanent System User token)

You need full access to the business portfolio that owns your WhatsApp app.

  1. Log in to Meta Business Suite, select your business portfolio and click Go to business settings (or the Settings gear icon).
  2. In the left menu, open Users → System users.
  3. Click + Add, enter a name (for example, loginradius-whatsapp), choose the Admin or Employee role and click Create system user.
  4. Select the new system user and click Assign assets. Choose Apps, select your WhatsApp app, turn on Manage app (full control) and click Assign assets. Reload the page to confirm that the app is assigned.
  5. If you chose the Employee role, also give the system user access to your WhatsApp account: go to Accounts → WhatsApp accounts, select your account, open the People tab, click + Add people and select the system user. An Admin system user has this access by default.
  6. Back in Users → System users, select the system user and click Generate token.
  7. Select your app and set the token expiry to Never.
  8. Under Assign permissions, select the permissions.
  9. Click Generate token and copy the token right away. Meta shows it only once. You'll paste it into LoginRadius in Part B.

Step 4: Create the WhatsApp Message Template

Templates are created and managed in WhatsApp Manager, which is part of your Meta business account.

WhereLink
WhatsApp Manager (home)business.facebook.com/latest/whatsapp_manager
Message templates (create, view, edit)business.facebook.com/latest/whatsapp_manager/message_templates
  1. Open WhatsApp Manager and log in with the Meta account that owns your WhatsApp Business Account. If you manage several accounts, select the right business portfolio and WhatsApp Business Account at the top of the page.
  2. Open Account tools → Message templates, or go directly to Message templates.
  3. Click Create template and follow the steps below.

Create a template with a placeholder

  1. Choose the category and language that fit your messages, and enter a template name (for example, loginradius_message).

  2. In the Body, write the fixed text of your message and add a variable, {{1}}, where the LoginRadius message content should be inserted. For example:

    Message from Acme: {{1}}
    Thank you for using Acme.
  3. When prompted, add a sample value for {{1}}, for example Your verification code is 123456.

  4. Submit the template for review.

LoginRadius fills {{1}} with the text of your LoginRadius SMS template (see Step B2).

Meta reviews every template before it can be used. Keep these rules in mind:

  • The body can't start or end with a variable, so a body of only {{1}} is rejected. Always add fixed text before and after it.
  • Meta assigns the final category based on the template's content. For the category and content guidelines, see Template categorization.

Step 5: View and Edit Your Templates

  • View: go to WhatsApp Manager → Message templates. The list shows each template's name, category, language and status (Active, In review, Rejected, Paused).
  • Edit: open the template and click Edit.
  • Delete: if you delete an approved template, you can't reuse its name for a new template for a period of time, so prefer editing.

Step 6: Send a Test Message from Meta

Before you configure LoginRadius, confirm that Meta can send your template. Replace the placeholders and run:

curl -X POST "https://graph.facebook.com/v25.0/<PHONE_NUMBER_ID>/messages" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"messaging_product": "whatsapp",
"to": "<RECIPIENT_NUMBER_WITH_COUNTRY_CODE>",
"type": "template",
"template": {
"name": "<TEMPLATE_NAME>",
"language": { "code": "en_US" },
"components": [
{ "type": "body", "parameters": [ { "type": "text", "text": "This is a test message" } ] }
]
}
}'

Part B: Configure LoginRadius

Step 1: Configure the Custom Text/SMS Provider

  1. Log in to the LoginRadius Admin Console.
  2. Go to Branding → Email / SMS Provider.
  3. Under SMS providers, select Custom Text/SMS Provider.
  4. Fill in the fields:
FieldValue
Delivery provider URLhttps://graph.facebook.com/v25.0/<PHONE_NUMBER_ID>/messages
Authentication typeBearer. Paste the System User access token from Step A3.
HTTP methodPOST
Body TypeJSON (required)
Headers (optional)Content-Type = application/json
BodySee below

Body:

{"messaging_product":"whatsapp","to":"#receiver#","type":"template","template":{"name":"<TEMPLATE_NAME>","language":{"code":"en_US"},"components":[{"type":"body","parameters":[{"type":"text","text":"#template#"}]}]}}

Replace <TEMPLATE_NAME> and the language code with the exact values from Step A4. If your WhatsApp template has more than one variable, add one parameters entry per variable, in order. Only one of them can be dynamic (#template#); the others must be fixed text.

  1. Click Save. Reload the page and check that the body was saved.

Placeholders in the provider body

PlaceholderLoginRadius replaces it with
#receiver#The user's phone number with country code
#template#The rendered text of the SMS template for the current flow (see Step 2)

Step 2: Set Up Your SMS Templates

The text of each LoginRadius SMS template becomes the value of #template#, and so the content of the WhatsApp variable {{1}}.

  1. Go to Branding → SMS Templates.

  2. Open each SMS template your app uses (for example, phone verification, forgot password, passwordless login, MFA and welcome messages).

  3. Write the message text you want to send, using LoginRadius placeholders such as #OTP# as usual. For example:

    Your verification code is #OTP#

    With the example template from Step 4, the user receives on WhatsApp: "Message from Acme: Your verification code is 123456 Thank you for using Acme."

Test the Integration

  1. Trigger an SMS flow in your app, for example phone verification, Forgot password by phone or Passwordless login by phone, using a phone number that can receive WhatsApp messages. If you use Meta's test number, it must be on the allowed list.
  2. Check WhatsApp on that phone. You should receive your WhatsApp template with the LoginRadius SMS text in place of {{1}}.
  3. Complete the flow, for example by entering the code.