Generate the One Time Password or Verification Token and send to the recipient.
POST
/verify/v1/otp/send-otp
Authentication
AUTHORIZATION: Bearer Token
Request parameters
Parameter
Value / Pattern
Example
*originator
The Sender/Header of a message. We can use your brand name with a maximum character limit of 11 or your mobile number with your country code.
D7Web
*recipients
Mobile Numbers to send OTP Code. The recipient's phone number should have a country code prefix.
9715097526xx
*content
OTP Message Content with {} placeholder
Greetings from D7 API, your mobile verification code is: {}
*expiry
OTP Expiry time in seconds
300
data_coding
Set as text for normal GSM 03.38 characters(English, normal characters). Set as unicode for non GSM 03.38 characters (Arabic, Chinese, Hebrew, Greek like regional languages and Unicode characters). Set as auto so we will find the data_coding based on your content.
auto
*retry_delay
Regeneate OTP delay
60
*retry_count
Regeneate OTP limit
3
*otp_code_length
Length of OTP code. Minimum 2 to maximum 10
6
*otp_type
Should be an enum with values: numeric, alpha, or alphanumeric
numeric
*template_id
You can create a verification template in the dashboard and call it from the request
varaxios=require('axios');vardata=JSON.stringify({"originator":"SignOTP","recipient":"{{recipient1}}","content":"Greetings from D7 API, your mobile verification code is: {}","expiry":"600","data_coding":"text"});varconfig={method:'post',url:'https://api.d7networks.com/verify/v1/otp/send-otp',headers:{'Authorization':'Bearer {{api_access_token}}','Content-Type':'application/json'},data:data};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
importrequestsimportjsonurl="https://api.d7networks.com/verify/v1/otp/send-otp"payload=json.dumps({"originator":"SignOTP","recipient":"{{recipient1}}","content":"Greetings from D7 API, your mobile verification code is: {}","expiry":"600","data_coding":"text"})headers={'Authorization':'Bearer {{api_access_token}}','Content-Type':'application/json'}response=requests.request("POST",url,headers=headers,data=payload)print(response.text)
varsettings={"url":"https://api.d7networks.com/verify/v1/otp/send-otp","method":"POST","timeout":0,"headers":{"Authorization":"Bearer {{api_access_token}}","Content-Type":"application/json"},"data":JSON.stringify({"originator":"SignOTP","recipient":"{{recipient1}}","content":"Greetings from D7 API, your mobile verification code is: {}","expiry":"600","data_coding":"text"}),};$.ajax(settings).done(function(response){console.log(response);});
varheaders={'Authorization':'Bearer {{api_access_token}}','Content-Type':'application/json'};varrequest=http.Request('POST',Uri.parse('https://api.d7networks.com/verify/v1/otp/send-otp'));request.body=json.encode({"originator":"SignOTP","recipient":"{{recipient1}}","content":"Greetings from D7 API, your mobile verification code is: {}","expiry":"600","data_coding":"text"});request.headers.addAll(headers);http.StreamedResponseresponse=awaitrequest.send();if(response.statusCode==200){print(awaitresponse.stream.bytesToString());}else{print(response.reasonPhrase);}
$headers=New-Object"System.Collections.Generic.Dictionary[[String],[String]]"$headers.Add("Authorization","Bearer {{api_access_token}}")$headers.Add("Content-Type","application/json")$body="{`n`"originator`": `"SignOTP`",`n`"recipient`": `"{{recipient1}}`",`n`"content`": `"Greetings from D7 API, your mobile verification code is: {}`",`n`"expiry`": `"600`",`n`"data_coding`": `"text`"`n}"$response=Invoke-RestMethod'https://api.d7networks.com/verify/v1/otp/send-otp'-Method'POST'-Headers$headers-Body$body$response|ConvertTo-Json
require"uri"require"json"require"net/http"url=URI("https://api.d7networks.com/verify/v1/otp/send-otp")https=Net::HTTP.new(url.host,url.port)https.use_ssl=truerequest=Net::HTTP::Post.new(url)request["Authorization"]="Bearer {{api_access_token}}"request["Content-Type"]="application/json"request.body=JSON.dump({"originator":"SignOTP","recipient":"{{recipient1}}","content":"Greetings from D7 API, your mobile verification code is: {}","expiry":"600","data_coding":"text"})response=https.request(request)putsresponse.read_body
varclient=newHttpClient();varrequest=newHttpRequestMessage(HttpMethod.Post,"https://api.d7networks.com/verify/v1/otp/send-otp");request.Headers.Add("Authorization","Bearer {{api_access_token}}");varcontent=newStringContent("{\n \"originator\": \"SignOTP\",\n \"recipient\": \"{{recipient1}}\",\n \"content\": \"Greetings from D7 API, your mobile verification code is: {}\",\n \"data_coding\": \"auto\" \n}",null,"application/json");request.Content=content;varresponse=awaitclient.SendAsync(request);response.EnsureSuccessStatusCode();Console.WriteLine(awaitresponse.Content.ReadAsStringAsync());
Unique id for each otp request. Users can use this otp_id to regenerate otp or verify otp.
status
The status of sms request. Possible request status are OPEN (authentication is approved and is waiting for a response), APPROVED (authentication has been approved), EXPIRED (authentication has expired) and FAILED (There was an error while sending notification)