Technology How to Send Authentication Messages via Whatsapp Using ShauriWave

How to Send Authentication Messages via Whatsapp Using ShauriWave

Jun 18, 2024
About:

Sending authentication messages via WhatsApp is essential for verifying user identities and securing online accounts. Learn how to use ShauriWave’s API to send these messages efficiently and securely.

How to Send Authentication Messages via WhatsApp Using ShauriWave

Sending authentication messages via WhatsApp is crucial for verifying user identities and securing online accounts. ShauriWave simplifies this process with its API, allowing seamless integration into your systems. Here's a step-by-step guide on how to send authentication messages using ShauriWave.

Step 1: Set Up Your Account

Before you begin, ensure you have an account with ShauriWave and have obtained the necessary API credentials, including your bearer_token and waba_id.

Step 2: Create an Authentication Template

To send authentication messages, you'll need an authentication message template. This template will be used to format your messages. Make sure the template is categorized as an authentication template in ShauriWave's system.

Step 3: Sending an Authentication Message

To send an authentication message, you will use the following endpoint:

POST /message/template/authentication/{waba_id}

Required Parameters

  • template_id: The ID of your authentication message template.
  • phone: The recipient's phone number, including the country code.
  • code: The authentication code you wish to send.
  • waba_id: Your onboarded phone number's waba_id.
  • save_message (optional): A boolean flag indicating whether to save the message as a chat.

Sample Payload

Here’s an example of the JSON payload you would send:

{
  "template_id": "396424149762513",
  "phone": "254711536733",
  "code": "200500",
  "save_message": true
}

Step 3: Handle the Response

A successful request will return a response indicating that the message was sent. For example:

{
  "message": "Message sent successfully!",
  "data": {
    "message_id": "wamid.HBgMMjU0NzExNTM2NzMzFQIAERgSRTFDNDBGOUIzRDFEMjA2QkZCAA=="
  }
}

If there are any errors, the response will detail what went wrong, such as missing fields or incorrect template IDs.

Conclusion

Using ShauriWave to send authentication messages via WhatsApp is efficient and straightforward. By following these steps, you can integrate secure authentication into your applications, enhancing user security and trust.

For more detailed information and troubleshooting, visit the Shauri Wave Documentation.