हिन्दी में पढ़ें

Send OTP without DLT in PHP and Laravel

To send OTP without DLT in PHP, post the number to DiOTP's /v1/otp/send endpoint with cURL or Laravel's Http facade, keep the request_id in the session, and post it with the typed code to /v1/otp/verify. The SMS goes out on DiOTP's registered DIORBT header and pre-approved OTP template, so you register nothing with DLT. Your PHP code stays the same when you move to your own sender ID later.

By , Founder, Diorbit TechnologiesUpdated

Key facts

Price
₹0.26 to ₹0.40 per OTP plus 18% GST, from a prepaid wallet. No setup fee, no monthly fee.
Setup time
Same day. Test on your own number in minutes, then go live.
Sender name
DIORBT, DiOTP's registered header (shown with an operator prefix, for example VM-DIORBT).
Message
"123456 is your login OTP for Your Company. Do not share it with anyone. Powered by Diorbit Technologies!" The wording is fixed; your company name fills the name slot.
Compliance
Sent under DiOTP's own registered DLT entity, header and pre-approved OTP template. You register nothing.
Limits per number
1 code every 30 seconds, 3 per hour, 10 per day.
Later
Move to your own sender ID when your DLT registration is ready, with no code changes.

What does this guide add to the general PHP OTP guide?

This page is about one situation: you have a PHP or Laravel app, you need phone verification working this week, and you have not finished (or not started) your own DLT registration. That is what OTP without DLT on DiOTP is for. Your codes go out under DiOTP's own registered DLT entity, the DIORBT header and a pre-approved OTP template, and you start the same day.

For the full walkthrough of the API in PHP and .NET, including webhooks and an ASP.NET Core example, read the PHP and .NET OTP API guide. This page does not repeat it. It covers what is different when you start on the shared template: what your users will see, the errors that only show up on a trial and on the shared template, a reusable client class instead of a one-file script, a Laravel controller, and how the switch to your own sender ID works without touching code.

We use plain HTTP calls throughout. You do not need a package: the API is two POST requests. The SDKs page lists the official Node.js and Python packages for other parts of your stack.

What will your users see on the shared template?

Before you write a line of PHP, know the message, because you cannot change it while you are on the shared template. The sender shows as DIORBT, usually with an operator prefix such as VM-DIORBT. The text is fixed:

Text message

VM-DIORBT

482913 is your login OTP for Acme. Do not share it with anyone. Powered by Diorbit Technologies!

The shared template: the code, your company name in the name slot, from the DIORBT header.
  • Only two parts change: the code and your company name. The name slot holds up to 30 characters.
  • The wording says "login OTP", so it fits login and signup verification well. A delivery code, an appointment check or a payment confirmation reads better on your own template.
  • Order updates, shipping alerts, reminders and promotions are not OTPs at all. They always need your own DLT registration, whatever provider you use.

So set purpose to login or signup for the flows below. The purpose field is a label for your own reports; it does not change the message. To see exactly how your company name will look in the SMS, try the OTP message preview.

How do you send OTP without DLT in PHP, step by step?

  1. Sign up for DiOTP and create an API key in the dashboard. A new account gets 10 free test messages, sent only to the mobile number you verified at sign-up.
  2. Set the key as the DIOTP_API_KEY environment variable on your server (in your PHP-FPM pool, your hosting panel or Laravel's .env file). Never put it in a file inside the web root.
  3. Add the DiotpClient class below to your project, or the Laravel controller if you use Laravel.
  4. On the send step, call send() with the 10 digit number and store the returned request_id in the server-side session.
  5. On the verify step, call verify() with the stored request_id and the typed code. On success, regenerate the session id and mark the number as verified.
  6. Map the error codes to messages, test on your own number, then recharge your wallet to send to any Indian mobile number.

A reusable PHP client class with cURL

The class wraps both calls and turns every error reply into a DiotpError with the HTTP status and the stable error code. It needs PHP 8.1 or newer for readonly properties. Every send carries an Idempotency-Key, so if you retry after a timeout the user cannot get two codes for one tap.

src/DiotpClient.php

<?php
// src/DiotpClient.php: plain PHP 8.1+, needs only the curl and json extensions.
declare(strict_types=1);

final class DiotpError extends RuntimeException
{
    public function __construct(
        public readonly int $status,
        public readonly string $errorCode,
        string $message = '',
    ) {
        parent::__construct("$status $errorCode: $message");
    }
}

final class DiotpClient
{
    private const BASE = 'https://api-diotp.diorbit.com/v1';

    public function __construct(private string $apiKey) {}

    public static function fromEnv(): self
    {
        $key = getenv('DIOTP_API_KEY');
        if ($key === false || $key === '') {
            throw new LogicException('DIOTP_API_KEY is not set');
        }
        return new self($key);
    }

    /** Sends a code and returns the request_id. The code itself never reaches you. */
    public function send(string $phone, string $purpose = 'login', ?string $idempotencyKey = null): string
    {
        $body = ['to' => $phone, 'country_code' => 91, 'channel' => 'sms', 'purpose' => $purpose];
        $key = $idempotencyKey ?? bin2hex(random_bytes(16));
        return $this->post('/otp/send', $body, ['Idempotency-Key: ' . $key])['request_id'];
    }

    /** Returns true when the code is right. Throws DiotpError otherwise. */
    public function verify(string $requestId, string $code): bool
    {
        $data = $this->post('/otp/verify', ['request_id' => $requestId, 'code' => $code]);
        return ($data['verified'] ?? false) === true;
    }

    private function post(string $path, array $body, array $extra = []): array
    {
        $ch = curl_init(self::BASE . $path);
        curl_setopt_array($ch, [
            CURLOPT_POST => true,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT => 10,
            CURLOPT_HTTPHEADER => [
                'Authorization: Bearer ' . $this->apiKey,
                'Content-Type: application/json',
                ...$extra,
            ],
            CURLOPT_POSTFIELDS => json_encode($body, JSON_THROW_ON_ERROR),
        ]);
        $raw = curl_exec($ch);
        $status = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
        curl_close($ch);

        if ($raw === false) {
            throw new DiotpError(0, 'network_error', 'No response from DiOTP');
        }
        $data = json_decode((string) $raw, true) ?? [];
        if ($status >= 400) {
            $err = $data['error'] ?? [];
            throw new DiotpError($status, $err['code'] ?? 'unknown', $err['message'] ?? '');
        }
        return $data;
    }
}

Notice that send() returns only the request_id. DiOTP generates and stores the code; your PHP never sees it. That keeps codes out of your database, your logs and your error tracker, and it means there is nothing for you to hash or expire.

Here is the class in use, in a plain PHP page with a native session. It handles both steps of one form, with a hidden step field:

login-otp.php

<?php
// login-otp.php: two small handlers on top of the client, with a PHP session.
declare(strict_types=1);
require __DIR__ . '/src/DiotpClient.php';
session_start();

$otp = DiotpClient::fromEnv();
$phone = preg_replace('/\D/', '', (string) ($_POST['phone'] ?? ''));

if (($_POST['step'] ?? '') === 'send') {
    try {
        $_SESSION['otp_request_id'] = $otp->send($phone, 'login');
        $_SESSION['otp_phone'] = $phone;
        $notice = 'We have sent a code to your phone.';
    } catch (DiotpError $e) {
        $notice = otp_message($e); // see the error section below
    }
}

if (($_POST['step'] ?? '') === 'verify' && isset($_SESSION['otp_request_id'])) {
    try {
        if ($otp->verify($_SESSION['otp_request_id'], (string) ($_POST['code'] ?? ''))) {
            session_regenerate_id(true);
            $_SESSION['verified_phone'] = $_SESSION['otp_phone'];
            unset($_SESSION['otp_request_id'], $_SESSION['otp_phone']);
            header('Location: /account');
            exit;
        }
    } catch (DiotpError $e) {
        $notice = otp_message($e);
    }
}

session_regenerate_id(true) on success gives the visitor a fresh session id at the moment they gain access, which closes off session fixation. These are the raw requests the class makes, if you want to compare:

curl -X POST https://api-diotp.diorbit.com/v1/otp/send \
  -H "Authorization: Bearer $DIOTP_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 5f2b8c1e-signup-9876543210" \
  -d '{
    "to": "9876543210",
    "country_code": 91,
    "channel": "sms",
    "purpose": "signup"
  }'
curl -X POST https://api-diotp.diorbit.com/v1/otp/verify \
  -H "Authorization: Bearer $DIOTP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "code": "482913"
  }'

Which errors matter on a trial and on the shared template?

Most error handling advice treats every error the same. On a new DiOTP account, a few codes come up more often than others, and they mean very different things. Branch on the code, never on the message text.

CodeStatusWhat it meansWhat to do
trial_restricted403You sent to a number other than your verified one while in test mode.Test on your own number, or recharge to go live.
trial_used_up402The 10 free test messages are spent.Recharge your wallet. The same key then works for every Indian number.
insufficient_balance402Your wallet is empty after going live.Recharge. Alert your team, users cannot fix this.
resend_cooldown429A code went to this number less than 30 seconds ago.Tell the user to wait; keep the resend button disabled for 30 seconds.
phone_hourly_limit429Three codes to this number in the last hour.Ask the user to try later.
phone_daily_limit429Ten codes to this number today.Ask the user to try tomorrow.
template_not_available422You passed a template id that your account cannot use.Leave template out to use the shared template.
channel_not_enabled409You asked for whatsapp and it is not enabled on your account.Use channel sms, or ask for WhatsApp to be enabled.

On verify, the user-facing codes are invalid_code (400), expired (410, codes last 5 minutes), not_pending (409) and too_many_attempts (429, after 5 wrong tries). already_verified (409) usually means a double tap, and you can treat it as success. Codes blocked by a rate limit are not sent and not charged.

otp-errors.php

<?php
// What to show, and what to alert on. Branch on the code, never on the message text.
function otp_message(DiotpError $e): string
{
    return match ($e->errorCode) {
        'resend_cooldown'    => 'Please wait 30 seconds before asking for another code.',
        'phone_hourly_limit' => 'Too many codes for this number. Please try again in an hour.',
        'phone_daily_limit'  => 'Too many codes for this number today. Please try tomorrow.',
        'invalid_code'       => 'That code is not right. Please check the SMS and try again.',
        'expired', 'not_pending' => 'That code has expired. Please ask for a new one.',
        'too_many_attempts'  => 'Too many wrong tries. Please ask for a new code.',
        'invalid_request'    => 'Please enter a valid 10 digit mobile number.',
        default              => otp_alert($e),
    };
}

function otp_alert(DiotpError $e): string
{
    // trial_restricted: test mode only sends to your own verified number.
    // trial_used_up:    the 10 free test messages are spent; recharge to go live.
    // insufficient_balance, unauthorized, account_suspended, channel_not_enabled ...
    error_log(sprintf('DiOTP %d %s', $e->status, $e->errorCode)); // never log the key
    return 'We could not send your code right now. Please try again shortly.';
}

trial_restricted is the one that confuses people most. Your code works, your key is right, and the SMS still does not go out to a colleague's phone. That is test mode doing its job. Every code and status is listed in the OTP API reference.

How do you send OTP without DLT in Laravel with the Http facade?

In Laravel, keep the key in .env and read it through config/services.php, so config caching works and the key never appears in your code.

config/services.php and .env

// config/services.php (add this entry to the returned array)
'diotp' => [
    'key' => env('DIOTP_API_KEY'),
    'base_url' => env('DIOTP_BASE_URL', 'https://api-diotp.diorbit.com/v1'),
],

// .env (never commit this file)
// DIOTP_API_KEY=diotp_live_xxxxxxxx

Validation lives in two form requests rather than inside the controller. SendOtpRequest cleans what people type (spaces, dashes, a leading 0 or +91) in prepareForValidation and then checks for a 10 digit number starting with 6 to 9, so a bad number gets Laravel's usual 422 with a field error and never costs an API call. VerifyOtpRequest refuses the request outright when the session holds no pending code, and checks that the code is 4 to 10 digits.

app/Http/Requests/SendOtpRequest.php and VerifyOtpRequest.php

<?php
// app/Http/Requests/SendOtpRequest.php
namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class SendOtpRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true; // anyone may ask for a code; the throttle and DiOTP's limits guard it
    }

    /** Accept "+91 98765 43210", "098765 43210" and so on: keep the 10 digits. */
    protected function prepareForValidation(): void
    {
        $digits = preg_replace('/\D/', '', (string) $this->input('phone'));
        if (strlen($digits) === 12 && str_starts_with($digits, '91')) {
            $digits = substr($digits, 2);
        }
        if (strlen($digits) === 11 && str_starts_with($digits, '0')) {
            $digits = substr($digits, 1);
        }
        $this->merge(['phone' => $digits]);
    }

    public function rules(): array
    {
        return ['phone' => ['required', 'regex:/^[6-9][0-9]{9}$/']];
    }

    public function messages(): array
    {
        return ['phone.regex' => 'Please enter a valid 10 digit mobile number.'];
    }
}

// app/Http/Requests/VerifyOtpRequest.php
namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class VerifyOtpRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->session()->has('otp'); // no pending code: 403 before any API call
    }

    protected function prepareForValidation(): void
    {
        $this->merge(['code' => trim((string) $this->input('code'))]);
    }

    public function rules(): array
    {
        return ['code' => ['required', 'string', 'regex:/^[0-9]{4,10}$/']];
    }
}

The controller builds one configured PendingRequest with baseUrl, withToken and a timeout, so the send and verify methods stay short. The send retries only on a connection failure, with the same Idempotency-Key, and throw: false lets the controller read DiOTP's error body itself. The request_id lives in the Laravel session, never in the browser.

app/Http/Controllers/PhoneOtpController.php

<?php
// app/Http/Controllers/PhoneOtpController.php
namespace App\Http\Controllers;

use App\Http\Requests\SendOtpRequest;
use App\Http\Requests\VerifyOtpRequest;
use Illuminate\Http\Client\ConnectionException;
use Illuminate\Http\Client\PendingRequest;
use Illuminate\Http\Client\Response;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;

class PhoneOtpController extends Controller
{
    /** Codes the visitor can act on. Anything else is a setup or account problem. */
    private const USER_CODES = [
        'resend_cooldown', 'phone_hourly_limit', 'phone_daily_limit',
        'invalid_code', 'expired', 'not_pending', 'too_many_attempts', 'invalid_request',
    ];

    /** Seconds the visitor should wait, sent as Retry-After. */
    private const RETRY_AFTER = ['resend_cooldown' => 30, 'phone_hourly_limit' => 3600];

    /** After these verify errors the request_id is spent: start over. */
    private const FINISHED = ['expired', 'not_pending', 'too_many_attempts', 'not_found'];

    private const COOLDOWN = 30;

    private function diotp(): PendingRequest
    {
        return Http::baseUrl(config('services.diotp.base_url'))
            ->withToken(config('services.diotp.key'))
            ->acceptJson()
            ->timeout(10);
    }

    public function send(SendOtpRequest $request): JsonResponse
    {
        $phone = $request->validated('phone');

        // Mirror DiOTP's 30 second cooldown: an instant 429, no API call.
        $pending = $request->session()->get('otp');
        if ($pending && $pending['phone'] === $phone) {
            $wait = self::COOLDOWN - (now()->timestamp - $pending['sent_at']);
            if ($wait > 0) {
                return response()->json(['error' => 'resend_cooldown', 'retry_after' => $wait], 429)
                    ->header('Retry-After', (string) $wait);
            }
        }

        try {
            $res = $this->diotp()
                ->withHeaders(['Idempotency-Key' => (string) Str::uuid()])
                ->retry(2, 500, fn ($e) => $e instanceof ConnectionException, throw: false)
                ->post('/otp/send', [
                    'to' => $phone,
                    'country_code' => 91,
                    'channel' => 'sms',
                    'purpose' => 'signup',
                ]);
        } catch (ConnectionException) {
            return response()->json(['error' => 'sending_unavailable'], 503);
        }

        if ($res->failed()) {
            return $this->fail($res);
        }

        $request->session()->put('otp', [
            'request_id' => $res->json('request_id'),
            'phone' => $phone,
            'sent_at' => now()->timestamp,
        ]);
        return response()->json(['sent' => true, 'expires_at' => $res->json('expires_at')]);
    }

    public function verify(VerifyOtpRequest $request): JsonResponse
    {
        $pending = $request->session()->get('otp');
        if (! $pending) {
            return response()->json(['error' => 'no_pending_code'], 400);
        }

        $res = $this->diotp()->post('/otp/verify', [
            'request_id' => $pending['request_id'],
            'code' => $request->validated('code'),
        ]);

        $code = $res->json('error.code');
        if ($res->failed() && $code !== 'already_verified') {
            if (in_array($code, self::FINISHED, true)) {
                $request->session()->forget('otp'); // this request is spent
            }
            return $this->fail($res);
        }

        $request->session()->forget('otp');
        $request->session()->regenerate();
        $request->session()->put('verified_phone', $pending['phone']);
        return response()->json(['verified' => true]);
    }

    private function fail(Response $res): JsonResponse
    {
        $code = (string) $res->json('error.code', 'unknown');
        if (in_array($code, self::USER_CODES, true)) {
            $reply = response()->json(['error' => $code], $res->status());
            if (isset(self::RETRY_AFTER[$code])) {
                $reply->header('Retry-After', (string) self::RETRY_AFTER[$code]);
            }
            return $reply;
        }
        Log::error('DiOTP setup or account error', ['status' => $res->status(), 'code' => $code]);
        return response()->json(['error' => 'otp_unavailable'], 503);
    }
}

The fail() method splits errors in two. Codes the visitor can act on go back to the front end as they are. Everything else, including trial_restricted, trial_used_up and insufficient_balance, is logged at error level and hidden behind a generic otp_unavailable, because a visitor cannot fix your wallet and should not learn how your setup works.

Session handling

The session holds one small array under the otp key: the request_id, the phone it was sent to and the send time. Each part has a job. The request_id never leaves the server, so nobody can submit a code against someone else's request. The phone is what gets marked as verified, so a visitor cannot swap numbers between the two steps. The send time lets the controller answer a second tap within 30 seconds with an instant 429 and a Retry-After header, without calling DiOTP. DiOTP still enforces the real cooldown for every device, so this is a convenience for the user, not the protection.

On a successful verify the controller forgets the pending entry and calls regenerate(), which issues a new session id at the moment the visitor gains access and closes off session fixation. When DiOTP answers expired, not_pending, too_many_attempts or not_found, the entry is spent, so the controller forgets it and the next send starts clean. Replace the verified_phone line with your own sign-in, such as Auth::login($user) after finding or creating the user by phone. If you run several servers, use a shared session driver (database or redis) so the verify request finds the entry wherever it lands.

routes/web.php

<?php
// routes/web.php (session and CSRF come from the web middleware group)
use App\Http\Controllers\PhoneOtpController;
use Illuminate\Support\Facades\Route;

Route::middleware('throttle:10,1')->prefix('phone')->group(function () {
    Route::post('/otp/send', [PhoneOtpController::class, 'send'])->name('phone.otp.send');
    Route::post('/otp/verify', [PhoneOtpController::class, 'verify'])->name('phone.otp.verify');
});

The routes sit in the web group, so they get the session and CSRF protection your forms already use. throttle:10,1 allows ten requests a minute per visitor, which sits in front of DiOTP's own per-number limits and helps against SMS pumping. If you serve a separate front end through routes/api.php instead, keep the request_id on the server side another way, such as a cache entry keyed by a signed token.

A feature test with Http::fake

Http::fake replaces every outgoing call made through the Http facade, so the real controller, form requests and session run in the test without touching DiOTP or sending an SMS. Http::assertSent checks what would have gone out: the Bearer key, an Idempotency-Key, to as 10 digits and country_code as the integer 91.

tests/Feature/PhoneOtpTest.php

<?php
// tests/Feature/PhoneOtpTest.php: the whole flow, with no real HTTP call and no SMS.
namespace Tests\Feature;

use Illuminate\Http\Client\Request;
use Illuminate\Support\Facades\Http;
use Tests\TestCase;

class PhoneOtpTest extends TestCase
{
    protected function setUp(): void
    {
        parent::setUp();
        config([
            'services.diotp.key' => 'test_key',
            'services.diotp.base_url' => 'https://api-diotp.diorbit.com/v1',
        ]);
    }

    public function test_send_then_verify_marks_the_number_verified(): void
    {
        Http::fake([
            '*/otp/send' => Http::response(['request_id' => 'req_1', 'channel' => 'sms', 'expires_at' => '2026-12-03T10:05:00+00:00']),
            '*/otp/verify' => Http::response(['request_id' => 'req_1', 'verified' => true, 'verified_at' => '2026-12-03T10:01:00+00:00']),
        ]);

        $this->postJson('/phone/otp/send', ['phone' => '+91 98765 43210'])
            ->assertOk()
            ->assertJson(['sent' => true]);
        $this->assertSame('req_1', session('otp.request_id'));

        $this->postJson('/phone/otp/verify', ['code' => '482913'])
            ->assertOk()
            ->assertJson(['verified' => true]);
        $this->assertSame('9876543210', session('verified_phone'));
        $this->assertNull(session('otp'));

        Http::assertSent(fn (Request $r) => str_ends_with($r->url(), '/otp/send')
            && $r->hasHeader('Authorization', 'Bearer test_key')
            && $r->hasHeader('Idempotency-Key')
            && $r['to'] === '9876543210'
            && $r['country_code'] === 91);
    }

    public function test_a_second_tap_within_30_seconds_never_reaches_diotp(): void
    {
        Http::fake(['*/otp/send' => Http::response(['request_id' => 'req_1', 'channel' => 'sms', 'expires_at' => 'x'])]);

        $this->postJson('/phone/otp/send', ['phone' => '9876543210'])->assertOk();
        $this->postJson('/phone/otp/send', ['phone' => '9876543210'])
            ->assertStatus(429)
            ->assertHeader('Retry-After')
            ->assertJson(['error' => 'resend_cooldown']);

        Http::assertSentCount(1);
    }

    public function test_diotp_cooldown_is_passed_on_with_retry_after(): void
    {
        Http::fake(['*/otp/send' => Http::response(
            ['error' => ['code' => 'resend_cooldown', 'message' => 'wait']], 429,
        )]);

        $this->postJson('/phone/otp/send', ['phone' => '9876543210'])
            ->assertStatus(429)
            ->assertHeader('Retry-After', '30');
    }

    public function test_account_errors_are_hidden_from_the_visitor(): void
    {
        Http::fake(['*/otp/send' => Http::response(
            ['error' => ['code' => 'insufficient_balance', 'message' => 'recharge']], 402,
        )]);

        $this->postJson('/phone/otp/send', ['phone' => '9876543210'])
            ->assertStatus(503)
            ->assertJson(['error' => 'otp_unavailable']);
    }

    public function test_a_bad_number_is_rejected_before_any_api_call(): void
    {
        Http::fake();

        $this->postJson('/phone/otp/send', ['phone' => '12345'])
            ->assertStatus(422)
            ->assertJsonValidationErrors('phone');

        Http::assertNothingSent();
    }
}

Run it with php artisan test --filter=PhoneOtpTest. Laravel skips CSRF checks while running tests, and the session persists between the requests of one test, which is why the verify call finds the request_id saved by the send call. The second and third tests pin down the 30 second cooldown from both sides: your own check and DiOTP's 429. Every code these tests touch is listed on the error codes page.

What changes when you move to your own sender ID?

Nothing in your PHP. When your own DLT registration is approved, add your entity ID, header and template ID under Sender IDs in the DiOTP dashboard. The same DiotpClient class and the same Laravel controller keep working. Codes then go out under your own header and your own wording instead of DIORBT.

You can keep sending on the shared template while your registration is in review, so there is no gap for your users. When you are ready, the DLT registration guide walks through the paperwork. Two reasons to make the move: you want your brand as the sender, or you need wording other than "login OTP", for example for delivery or payment codes.

Cost does not change with the move. You pay ₹0.26 to ₹0.40 per OTP plus 18% GST from a prepaid wallet, with no setup fee, no monthly fee and no extra charge for the shared template.

Questions and answers

Do I need DLT registration to send OTP from PHP?

Not with DiOTP. Your codes go out under DiOTP's registered DLT entity, the DIORBT header and a pre-approved OTP template. You need only an account and an API key.

Do I need a Composer package to use DiOTP from PHP?

No. The API is two HTTPS POST requests, which plain cURL or Laravel's Http facade handles in a few lines, as this guide shows. The official packages are for Node.js and Python.

Why does my PHP code get trial_restricted?

Your account is in test mode, and test messages go only to the mobile number you verified at sign-up. Test on that number, or recharge your wallet to send to any Indian mobile number.

Can I change the SMS wording from my PHP code?

Not on the shared template. Only the code and your company name change. For your own wording, register your own DLT template and add it under Sender IDs in the dashboard.

Where should I keep the API key in Laravel?

In the .env file as DIOTP_API_KEY, read through config/services.php. Never commit .env, log the key or send it to a browser.

Will my Laravel controller change when I get my own sender ID?

No. You add your entity ID, header and template ID under Sender IDs in the dashboard, and the same send and verify calls keep working.

Send your first OTP today.

Free test credits on sign-up, API keys in a minute, and a team that picks up the phone.