WhatsApp Authentication

Send WhatsApp OTP

Sends a new OTP to the user's WhatsApp number. This should be the first step in the authentication flow. Check out the Whatsapp Auth template script for more details.

POST
/api/oc/v1/authenticate/whatsapp

Request Body

application/jsonRequired
dataRequiredobject
client_signatureRequiredstring

Signature of data using eth_sign

typeRequiredstring
Value in: "ethsign"
curl -X POST "https://sandbox-api.okto.tech/api/oc/v1/authenticate/whatsapp" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "whatsapp_number": "9871170638",
      "country_short_name": "IN",
      "client_swa": "0xC06Cb1847f8cd185EB61980ec78311A1935c3Fd5",
      "timestamp": 1744199446352
    },
    "client_signature": "0xa4363f9c3a5e05ca204080b72b869e0daa4be43d91dead3305377a20b7b416802dac6b10a392672b1a69b7fdbe4667a8d916fb158dafffc7d2de9b797a1d2c191c",
    "type": "ethsign"
  }'

OTP sent successfully

{
  "status": "success",
  "data": {
    "status": "success",
    "message": "phone otp sent",
    "code": 200,
    "token": "c67931f6-a8b1-511c-91d5-9fc88231d541",
    "trace_id": "0000000000000000208338242c787032"
  }
}