Generate the One Time Password or Verifiaction Token and send to the recipient.
POST
/verify/v1/otp/send-otp
Authentication
AUTHORIZATION: Bearer Token
Request parameters
Parameter
Value / Pattern
*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.
*recipients
Mobile Numbers to send OTP code.
*content
OTP Message Content with {} placeholder
*expiry
OTP Expiry time in seconds
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.
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
Response
When the request is validated, otp_id, status and expiry will be returned. Users can use this otp_id to regenerate otp or verify otp