Skip to content

Tutorial: Send OTP Message via API

This tutorial will guide you through sending a One-Time Password (OTP) message using Contacta’s API.

  • A Contacta account
  • Your API key
  • The recipient’s phone number

First, obtain your API key from your Contacta dashboard.

You can send an OTP message by making a POST request to the Contacta API endpoint.

developer@developer:~#
{
"msg": "Your otp code is [code], please don't share it with anyone.",
"phone": "8100001234",
"sender": "AWESOMEINC",
"id": "my-external-id"
}
developer@developer:~#
curl -X POST "https://api.example.com/v2/otp/send"
-H "Accept: application/json"
-H "Connection: keep-alive"
-H "Content-Type: application/json"
-H "Authorization: Basic <base64-encoded-credentials>"
-d @payload.json