API Documentation

How It Works?

  • Your app user tries to initiates an action, like trying to sign in.
  • You send a request to our API with data that includes:
    • Your API Key (mandatory)
    • User WhatsApp number (mandatory: number will be with country code and without + symbol)
    • An OTP that you’ve generated (optional: we will generate a random 6-digits code for you if you dont provide yours)
  • If the above requirements are provided, we will respond with some data including the status, queue ID, verification code and other information.
  • We immediately sends your OTP via WhatsApp to the user's number.
  • Your user inserts the OTP on your app.
  • You compare the user inserted OTP to the one generated for this attempt.

Sending code

Use this command to send a verification code to a recipient number.

curl --request POST \
     --url https://api.modaju.com/send \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data api_key=xxxxxxxxxx \
     --data phone=123456789
     --data code=123456

Verifying code

Use this command to verify a code that your user entered.

curl --request POST \
     --url https://api.modaju.com/verify \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data api_key=xxxxxxxxxx \
     --data code=xxxxxx \
     --data query_id=abcd12

Checking status

Use this command to check if a verification code has been sent to a recipient number.

curl --request POST \
     --url https://api.modaju.com/check \
     --header 'accept: application/json' \
     --header 'content-type: application/x-www-form-urlencoded' \
     --data api_key=xxxxxxxxxx \
     --data query_id=abcd12