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: An additional fee of €0.005 will be charged per successful request when using this API to generate and send OTP SMS.
API URL Endpoint: https://api.geniq.io/rest/v1/verify
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
recipient | integer | Yes | Recipient’s mobile number including country code without “+” prefix | |
reference | string | Optional | A unique reference ID for keeping track of requests and responses | |
originator | string | Yes | The originating address for the outgoing SMS message | |
template | string | Optional | The 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]. |
codeLength | integer | Optional | You can set the number of digits in the verification code. Must be between 6 and 8 | 6 |
expiry | integer | Optional | The verification code expiry time in seconds | 30 |
Sample request using CURL:
$ curl -X POST https://api.geniq.io/rest/v1/verify \
-H 'Authorization: Bearer [TOKEN]' \
-d "recipient=6591234567" \
-d "originator=Hello" \
-d "reference=12345" \
-d "expiry=300" \
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
reference | string | If reference parameter is submitted during OTP SMS API request, the same value will be returned |
responseMessage | string | Response message returned from the API call |
responseCode | integer | Response code returned from the API call. Refer to section “Response Codes” for list of possible values |
messageIds | array | A 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:
{
"reference":"12345",
"responseMessage":"Success",
"responseCode":"0",
"messageIds":["62bf1beb-9451-40b5-9171-6f45f8935111"]
}