1. Home
  2. Docs
  3. SMS Messaging
  4. Sending OTP SMS

Sending OTP SMS

You can use our OTP API to generate a One-Time Pin code based on RFC6238 and then send it to your recipient via SMS.

#Note: When using this API to generate and send OTP SMS, an additional fee of €0.005 will be charged per successful request.

API URL Endpoint:

recipientintegerYesRecipient’s mobile number including country code without “+” prefix
referencestringOptionalA unique reference ID for keeping track of requests and responses
originatorstringYesThe originating address for the outgoing SMS message
templatestringOptionalThe template of the message body. Make sure to include placeholder [CODE] in the message for the actual verification code to be replaced Your code is [CODE].
codeLengthintegerOptionalYou can set the number of digits in the verification code. Must be between 6 and 86
expiryintegerOptionalThe verification code expiry time in seconds30

Sample request using CURL:

$ curl -X POST https://api.geniq.io/rest/v1/verify \
    -H 'Authorization: Basic dXNlcjE6cGFzczE=' \
    -d "recipient=6591234567" \
    -d "originator=Hello" \
    -d "reference=12345" \
    -d "expiry=300" \

Parameters returned in the API response:

referencestringIf reference parameter is submitted during OTP SMS API request, the same value will be returned
responseMessagestringResponse message returned from the API call
responseCodeintegerResponse code returned from the API call. Refer to section “Response Codes” for list of possible values
messageIdsarrayA list of unique Ids for each SMS sent. If the SMS message length is too long, the API will automatically split it into multiple SMS parts and return the list of messageIds

Sample Response: