{"originator":"SignOTP","recipient":"{{recipient}}","content":"Greetings from D7 API, your mobile verification code is: {}",}
Body Parameters
Parameter
Type
Value
Default
recipient
String
The phone number of the recipient. The recipient's phone number should have a country code prefix.
-
originator
string
Brand name or number that shows up on the receiving phone, indicating who sent the text message.
D7VERIFY
content
String
OTP Message Content with {} as placeholder for the OTP.
-
template_id
Integer
You can create a template in the user dashboard for the OTP message content and use the id of that registered template instead of content parameter
-
channel
String
The channel through which OTP will be sent. (Options: SMS, WhatsApp. Default: SMS)
SMS
expiry
Integer
The maximum time in seconds, during which the OTP will be active and afterwards no verification can be done with that OTP .
600
data_coding
String
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.
text
retry_delay
Integer
The minimum time delay between frequent OTP resend requests in seconds.
60
retry_count
Integer
The number of times, the end user can request for OTP resend.
5
otp_code_length
Integer
The number of characters/digits in the OTP
6
otp_type
String
Direct7 supports three types of OTPs: alpha, numeric and alphanumeric
numeric
success_url
String
The postback url to which, the successful OTP delivery response to be sent.
-
failure_url
String
The postback url to which, the failed OTP delivery response to be sent.
-
Response
When the request is validated, request_id, status and created time will be returned. Users can use this request_id to
query status using the Get status endpoint.
{"detail":{"code":"ACCESS_TOKEN_SIGNATURE_VERIFICATION_FAILED","message":"It looks like your requests were failed due to a missing or invalid 'Access Token'. Sign up at https://app.d7networks.com and create an authentication token in the developer section."}}
402 - Payment Required
{"detail":[{"code":"INSUFFICIENT_CREDIT","message":"It looks like your requests failed due to insufficient credit on our account. Sign in at https://app.d7networks.com and make a payment to resume the messaging service on your account or contact [email protected] to get more test credits."}]}
constClient=require('direct7')constclient=newClient(apiToken="Your API token")constresponse=awaitclient.verify.sendOTP({originator:"SignOTP",recipient:"+9199999XXXXX",content:"Greetings from D7 API, your mobile verification code is: {}",expiry:600,data_coding:"text"})console.log(response);
fromdirect7importClientclient=Client(api_token="Your API token")client.verify.send_otp(originator="SignOTP",recipient="+97150900XXXX",content="Greetings from D7 API, your mobile verification code is: {}",expiry=600,data_coding="text")
require_once__DIR__.'/vendor/autoload.php';usedirect7\Direct7\Client;$client=newClient(api_token="Your API token")$response=$direct7->verify->sendOtp(originator:'SignOTP',recipient:'+91999999XXXX',content:'Greetings from D7 API, your mobile verification code is: {}',data_coding:'text',expiry:600);var_dump($response);
import("github.com/d7networks/direct7-go-sdk/direct7")apiToken:="Your Api Token"client:=direct7.NewClient(apiToken)verify:=direct7.NewVerify(client)originator:="SignOTP"recipient:="{{recipient}}"content:="Greetings from D7 API, your mobile verification code is: {}"dataCoding:="text"expiry:=600response,err:=verify.SendOTP(originator,recipient,content,dataCoding,expiry)
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'direct7'client=Direct7::Client.new('Your API token')client.verify.send_otp(originator="SignOTP",recipient="+97150900XXXX",content="Greetings from D7 API, your mobile verification code is: {}",expiry=600,data_coding="text")
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());
constClient=require('direct7')constclient=newClient(apiToken="Your API token")constresponse=awaitclient.verify.sendOTP({originator:"SignOTP",recipient:"+9199999XXXXX",template_id:25})console.log(response);
require_once__DIR__.'/vendor/autoload.php';usedirect7\Direct7\Client;$client=newClient(api_token="Your API token")$response=$direct7->verify->sendOtp(originator:'SignOTP',recipient:'+91999999XXXX',template_id:25);var_dump($response);
import("github.com/d7networks/direct7-go-sdk/direct7")apiToken:="Your Api Token"client:=direct7.NewClient(apiToken)verify:=direct7.NewVerify(client)originator:="SignOTP"recipient:="{{recipient}}"templateID:=25response,err:=verify.SendOTP(originator,recipient,templateID)