Copy-paste examples for the /send endpoint.
<?php
$ch = curl_init('https://softwearapp.com/otp-api/api/v1/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-Api-Key: ' . getenv('OTP_PK'),
'X-Api-Secret: ' . getenv('OTP_SK'),
],
CURLOPT_POSTFIELDS => json_encode(['email' => $email]),
]);
$res = json_decode(curl_exec($ch), true);
$requestId = $res['request_id'] ?? null;import os, requests
r = requests.post(
'https://softwearapp.com/otp-api/api/v1/send',
headers={'X-Api-Key': os.environ['OTP_PK'], 'X-Api-Secret': os.environ['OTP_SK']},
json={'email': 'user@example.com'},
timeout=15,
)
print(r.json()) # {'ok': True, 'request_id': 'req_…'}const res = await fetch('https://softwearapp.com/otp-api/api/v1/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Key': process.env.OTP_PK,
'X-Api-Secret': process.env.OTP_SK,
},
body: JSON.stringify({ email: 'user@example.com' }),
});
const data = await res.json();HttpClient client = HttpClient.newHttpClient();
HttpRequest req = HttpRequest.newBuilder(URI.create("https://softwearapp.com/otp-api/api/v1/send"))
.header("Content-Type", "application/json")
.header("X-Api-Key", System.getenv("OTP_PK"))
.header("X-Api-Secret", System.getenv("OTP_SK"))
.POST(HttpRequest.BodyPublishers.ofString("{\"email\":\"user@example.com\"}"))
.build();
String body = client.send(req, HttpResponse.BodyHandlers.ofString()).body();// Call YOUR backend from the app — never ship the secret inside the app.
final res = await http.post(
Uri.parse('https://your-backend.com/otp/send'),
headers: {'Content-Type': 'application/json'},
body: jsonEncode({'email': email}),
);curl -X POST https://softwearapp.com/otp-api/api/v1/send \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: pk_live_xxx' \
-H 'X-Api-Secret: sk_live_xxx' \
-d '{"email":"user@example.com"}'This action cannot be undone.