Getting Started#
Create an OTP application, obtain its API credentials, and complete your first verification through the REST API or an SDK. Start in the sandbox environment to test the integration before moving it to production.
Choose an environment#
Create the OTP application and credentials in the same environment as the Verification API endpoint you plan to use:
Environment |
User Panel |
Verification API base URL |
Use |
|---|---|---|---|
Sandbox |
|
Integration testing |
|
Production |
|
Live verifications |
Important
Credentials are environment-specific. Use credentials from a sandbox OTP application with the sandbox API, and credentials from a production OTP application with the production API.
The sandbox sends no real SMS or calls. Use its test numbers to get a fixed code or a chosen outcome. See Testing in sandbox.
Before you begin#
An account in the selected environment is required. For testing, open the DIDWW Sandbox User Panel. For production, sign in to the DIDWW Production User Panel or create a DIDWW account. You create the OTP application and copy its credentials in the User Panel of that environment.
A positive account balance is required for production. The verification fee is billed when a verification reaches
verified, in addition to the delivery cost. SMS delivery is billed per message sent and voice delivery per minute, at the rate for the destination country.A phone number you control is required when testing delivery through the production environment.
Step 1: Create an OTP application#
An OTP application groups the credentials and settings used by your verification requests. You need one before you can start verifications, because each request is tied to an OTP application key, secret, callback URL, and minimum authentication mode. An account can have up to 50 OTP applications.
Create the application in one of two ways. Both create an OTP application that you can use in the next steps:
Quick setup with Try it out: create an application with the default settings on the Get Started page and send a test verification right away.
Advanced configuration: create an application on the Applications page and configure all its settings.
Quick setup with Try it out#
Try it out on the OTP Verify > Get Started page creates a simplified OTP application with the default settings: minimum authentication mode Public, code length 6, code timeout 5 minutes, and DIDWW’s shared SMS senders. It then walks you through one complete verification: it sends a code to your phone, shows the API responses, and reports the code you received.
In the DIDWW User Panel, go to OTP Verify > Get Started. Use the DIDWW Sandbox User Panel for testing or the DIDWW Production User Panel for live verifications.
In Try it out, enter an Application name.
Optionally, enter a Callback URL. If it is set, DIDWW calls this URL before every verification and sends the code only if your server allows it. Leave it empty to test right away. See Callbacks.
Click Create. You can use the application in the next steps or change its settings later. See Edit an OTP application.
Fig. 1. Create an application with Try it out#
In the Send verification request tab, select the Application, the Method (SMS or Voice call), the Phone number of a phone you control, and the Language of the message. The Request panel shows the matching cURL request. Click Send.
Fig. 2. Send a test verification#
In the See verification response tab, review the API response with the
pendingstatus in the Response panel. When the code arrives on your device, click Next.
Fig. 3. Review the verification response#
In the Verify code tab, enter the code you received in OTP code and click Verify code. The Request panel shows the matching cURL request.
Fig. 4. Enter the received code#
In the Report Response tab, the Report response panel shows the
verifiedstatus, which confirms that the test succeeded. Details shows the application name, the API key, the API secret key, and the authentication mode. Click Restart to send another test verification.
Fig. 5. A successful test verification#
Note
Try it out authenticates its requests with basic authentication, so the test
works without a callback URL even though the application’s minimum authentication mode
is public. Each test verification is a real verification and is billed like any
other verification.
Advanced configuration#
Create an application on the Applications page to configure its authentication, verification codes, volume limits, conversion alerts, templates, and SMS senders. You can change these settings later by editing the application.
In the DIDWW User Panel, go to OTP Verify > Applications. Use the DIDWW Sandbox User Panel for testing or the DIDWW Production User Panel for live verifications.
Click Create application.
Fig. 6. Open the Create Application form#
Under General, enter an Application name that is unique within your account. Optionally, enter a Description to help identify the application in the list.
Under Configuration, enter a Callback URL if your integration will make requests with
publicauthentication, including the mobile SDK examples in this guide. Enter a valid HTTP or HTTPS URL for your backend. DIDWW sends aPOSTrequest to it before delivering the code, and your backend must approve or deny the verification. A configured callback is also used forbasicrequests. It is skipped forapplicationrequests. See Callbacks for the request and response format.Optionally, enter an iOS SMS domain, such as
example.com, for domain-bound code autofill on your website and associated iOS applications. Enter the hostname only, withouthttps://or a path, or leave it empty if you do not need this feature. For iOS applications, also configure Associated Domains as described in Domain-bound SMS. The domain line adds to the SMS length and can cause a message to use more than one segment.Choose the Minimum authentication mode, which is the weakest mode your application accepts:
Public (default): callers send the application key without the secret. Use it for mobile and web applications, with a callback URL to approve requests.
Basic: callers authenticate with the application key as the username and the secret as the password. Use it for requests from your backend.
Application: callers sign each request with the application secret using HMAC-SHA256. The callback URL is not called for these requests.
Stronger modes are also accepted. For example, Public allows Public, Basic, and Application requests, so you can keep it selected for the examples in this guide. See Minimum authentication mode values.
Fig. 7. General and Configuration settings of an OTP application#
Under Verification settings, select the Code length: from 4 to 8 digits. The default is 6.
Select the Code timeout: 1 min, 2 min, 5 min (default), or 10 min. To enter a different duration, select Custom and enter Custom code timeout (secs) as a whole number from 60 to 600. The timeout is counted from when the verification starts. See Verification settings.
Under Volume limits, review the Daily limit (default
1000) and Monthly limit (default15000). Each limit counts allowed verification starts across SMS and phone calls together. Enter a whole number from 1 to 10,000,000, or leave a field empty to disable that limit. When both are set, the daily limit must not exceed the monthly limit. Days and months reset at 00:00 UTC. DIDWW sends an email at 80% usage and when a limit is reached. New starts are rejected while the limit is reached. See Set volume limits.In the same section, set Low conversion alert (%) to a whole number from 0 to 100. Keep the default
50to receive an email when fewer than 50% of codes are entered for a country and delivery method within an hour, with at least 20 codes entered or expired. Enter0to turn the alert off. Emails go to the recipients of the OTP Applications notification. See Set a low conversion alert.Under Templates, choose an SMS template group and a Voice template group if you want to use custom SMS text or phone call greetings. Keep System templates for DIDWW’s defaults. These selections apply when a request does not specify its own template group. A group specified in the request takes precedence. Languages without an approved version use the system template. See Custom templates to create groups and submit their content for approval.
Optionally, under SMS Settings, search for and select dedicated senders in Sender IDs. Only senders verified on your account are listed, and each sender is used only for the destination countries where it is approved. If none is selected, DIDWW’s shared senders are used. If you have no verified senders, Get a Sender ID verified opens the verification process. You can also continue with the shared senders. See SMS Settings.
Review the settings and click Create to save the application. Continue with Step 2: Get your API credentials.
Fig. 8. Verification settings, volume limits, templates, and SMS settings of an OTP application#
Step 2: Get your API credentials#
Each OTP application has a key and a secret. See Credentials.
Copy the credentials from the OTP application in your selected environment. This walkthrough uses credentials created in the DIDWW Sandbox User Panel.
The REST API and Ruby SDK examples use both credentials with basic authentication. The
iOS and Android SDK examples use only the key with public authentication.
In the DIDWW User Panel, go to OTP Verify > Applications and locate the application you created.
In the Credentials column, copy the KEY and SECRET for that application. Use the copy icon to copy each value without revealing it on screen.
If you need to view the actual value before copying it, click the eye icon.
Fig. 9. Copy the key and secret from the Credentials column#
You can also copy them from the application page. See View application details.
Warning
Treat the secret like a password. Store it securely and never expose it in client-side code or public repositories. If it is leaked, rotate it. The key does not change, and you choose how long the previous secret keeps working, from revoking it immediately to a grace period of up to 7 days. See Rotating the secret.
Step 3: Start a verification#
Call the start endpoint with the destination number and
delivery method. The examples use the sandbox environment and send an SMS code to
+12015550100, a sandbox test number whose code is
123456 for the default code length.
Note
The REST API and Ruby SDK examples use basic authentication. The iOS and Android SDK
examples use public authentication, which requires the callback URL configured in
Step 1. An OTP application with minimum auth mode public accepts both authentication
modes. All examples use credentials created in the DIDWW Sandbox User Panel.
http
1POST /api/v1/verifications HTTP/1.1
2Host: verification-sandbox.didww.com
3Content-Type: application/json
4Accept: application/json
5Authorization: Basic eW91cl9hcHBfa2V5OnlvdXJfYXBwX3NlY3JldA==
6
7{
8 "data": {
9 "destination": "+12015550100",
10 "delivery_method": "sms",
11 "sms": {
12 "languages": ["en-US"]
13 }
14 }
15}
curl
1curl -i -X POST https://verification-sandbox.didww.com/api/v1/verifications -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"data": {"delivery_method": "sms", "destination": "+12015550100", "sms": {"languages": ["en-US"]}}}' --user your_app_key:your_app_secret
response
1HTTP/1.1 201 Created
2Content-Type: application/json
3
4{
5 "data": {
6 "id": "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
7 "destination": "12015550100",
8 "delivery_method": "sms",
9 "fee": "0.06",
10 "status": "pending",
11 "error_code": null,
12 "error_detail": null,
13 "expires_at": "2026-07-15T10:05:00.000Z",
14 "sms": {
15 "template": "Your code is {{CODE}}",
16 "language": "en-US",
17 "interception_timeout": 300,
18 "code_length": 6
19 }
20 }
21}
Note
The Authorization header contains the Base64 encoding of key:secret. Most
HTTP clients build this header when you supply the key as the username and the
secret as the password.
Install the Ruby SDK, then create a sandbox client and start the verification:
1require "didww/otp_verification"
2
3client = DIDWW::OTPVerification::Client.new(
4 key: "your-app-key",
5 secret: "your-app-secret",
6 env: :sandbox
7)
8
9verification = client.start_verification(
10 destination: "+12015550100",
11 delivery_method: "sms",
12 sms: {languages: ["en-US"]}
13)
14
15verification.id # => "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21"
16verification.status # => "pending"
17verification.pending? # => true
Install the Python SDK, then create a sandbox client and start the verification:
1from didww_verification import (
2 BasicAuth,
3 Environment,
4 SmsOptions,
5 VerificationClient,
6)
7
8client = VerificationClient(
9 BasicAuth("your-app-key", "your-app-secret"),
10 environment=Environment.SANDBOX,
11)
12
13verification = client.start_verification(
14 destination="+12015550100",
15 delivery_method="sms",
16 sms=SmsOptions(languages=["en-US"]),
17)
18
19verification.id # "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21"
20verification.status # "pending"
21verification.is_finished # False
AsyncVerificationClient is the same surface with await.
Install the Node.js SDK, then create a sandbox client and start the verification:
1import { VerificationClient, basicAuth } from '@didww/verification-core';
2
3const client = new VerificationClient({
4 auth: basicAuth('your-app-key', 'your-app-secret'),
5 environment: 'sandbox',
6});
7
8const verification = await client.startVerification({
9 destination: '+12015550100',
10 deliveryMethod: 'sms',
11 sms: { languages: ['en-US'] },
12});
13
14verification.id; // '0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21'
15verification.status; // 'pending'
Install the PHP SDK, then create a sandbox client and start the verification:
1use Didww\Verification\Auth\BasicAuth;
2use Didww\Verification\ClientOptions;
3use Didww\Verification\Environment;
4use Didww\Verification\Model\DeliveryMethod;
5use Didww\Verification\Request\SmsOptions;
6use Didww\Verification\VerificationClient;
7
8$client = new VerificationClient(
9 new BasicAuth('your-app-key', 'your-app-secret'),
10 new ClientOptions(environment: Environment::Sandbox),
11);
12
13$verification = $client->startVerification(
14 '+12015550100',
15 DeliveryMethod::Sms,
16 sms: new SmsOptions(languages: ['en-US']),
17);
18
19$verification->id; // "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21"
20$verification->status; // "pending"
21$verification->isFinished(); // false
Install the iOS SDK, then create a sandbox client with public authentication and start the verification:
1import DIDWWVerification
2
3let client = VerificationClient(
4 environment: .sandbox,
5 auth: .public(appKey: "your-app-key")
6)
7
8let verification = try await client.start(
9 destination: "+12015550100",
10 method: .sms,
11 sms: .init(languages: ["en-US"])
12)
13
14verification.id // "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21"
15verification.status // .pending
Install the Android SDK. Inside an
AndroidViewModel, create a sandbox client with public authentication and start
collecting the verification states. Calling start(...) creates a handle. The
request is sent when handle.states is first collected.
1import androidx.lifecycle.viewModelScope
2import com.didww.android.sdk.verification.Auth
3import com.didww.android.sdk.verification.DeliveryMethod
4import com.didww.android.sdk.verification.Environment
5import com.didww.android.sdk.verification.SmsOptions
6import com.didww.android.sdk.verification.VerificationState
7import com.didww.android.sdk.verification.all.DidwwVerification
8import kotlinx.coroutines.flow.MutableStateFlow
9import kotlinx.coroutines.launch
10
11val didww = DidwwVerification(
12 context = application,
13 auth = Auth.Public("your-app-key"),
14 environment = Environment.Sandbox,
15)
16
17val verificationState = MutableStateFlow<VerificationState>(
18 VerificationState.Starting,
19)
20
21val handle = didww.start(
22 destination = "+12015550100",
23 method = DeliveryMethod.SMS,
24 sms = SmsOptions(languages = listOf("en-US")),
25)
26
27viewModelScope.launch {
28 handle.states.collect { verificationState.value = it }
29}
Install the React Native SDK. Build the client once at module scope, then start the verification from the hook. The hook holds the state your screen renders from.
1import { VerificationClient, publicAuth } from '@didww/verification-core';
2import { useVerification } from '@didww/verification-react-native';
3
4const client = new VerificationClient({
5 auth: publicAuth('your-app-key'),
6 environment: 'sandbox',
7});
8
9const controller = useVerification({ client });
10
11controller.start({
12 destination: '+12015550100',
13 deliveryMethod: 'sms',
14 sms: { languages: ['en-US'] },
15});
16
17controller.state.kind; // 'starting', then 'awaitingInput'
Install the Dart SDK, then create a sandbox client and start the verification:
1import 'package:didww_verification/didww_verification.dart';
2
3final client = VerificationClient(
4 auth: const PublicAuthorization('your-app-key'),
5 environment: VerificationEnvironment.sandbox,
6);
7
8final started = await client.startVerification(
9 destination: '+12015550100',
10 deliveryMethod: DeliveryMethod.sms,
11 sms: const SmsOptions(languages: ['en-US']),
12);
13
14started.id; // '0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21'
15started.knownStatus; // VerificationStatus.pending
A Flutter screen usually wraps this in VerificationSession instead, which exposes
the same flow as a stream of states.
Keep the returned id, verification, handle, or controller, depending on your
integration.
You need it to report the code and read the verification status in the next steps.
Step 4: Report the code#
When the user enters the code they received, submit it to the report endpoint:
http
1PATCH /api/v1/verifications/0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21 HTTP/1.1
2Host: verification-sandbox.didww.com
3Content-Type: application/json
4Accept: application/json
5Authorization: Basic eW91cl9hcHBfa2V5OnlvdXJfYXBwX3NlY3JldA==
6
7{
8 "data": {
9 "delivery_method": "sms",
10 "code": "123456"
11 }
12}
curl
1curl -i -X PATCH https://verification-sandbox.didww.com/api/v1/verifications/0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21 -H "Accept: application/json" -H "Content-Type: application/json" --data-raw '{"data": {"code": "123456", "delivery_method": "sms"}}' --user your_app_key:your_app_secret
response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "data": {
6 "id": "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
7 "destination": "12015550100",
8 "delivery_method": "sms",
9 "fee": "0.06",
10 "status": "verified",
11 "error_code": null,
12 "error_detail": null,
13 "expires_at": "2026-07-15T10:05:00.000Z",
14 "sms": {
15 "template": "Your code is {{CODE}}",
16 "language": "en-US",
17 "interception_timeout": 300,
18 "code_length": 6
19 }
20 }
21}
1verification = client.report_verification(
2 "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
3 delivery_method: "sms",
4 code: "123456"
5)
6
7verification.status # => "verified"
8verification.verified? # => true
1verification = client.report_verification(
2 "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
3 delivery_method="sms",
4 code="123456",
5)
6
7verification.status # "verified"
An incorrect code raises DidwwValidationError with code_invalid (422), and
the verification stays pending for another attempt. Once three attempts are used, the
next report returns status failed.
1const result = await client.reportVerification(
2 '0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21',
3 { deliveryMethod: 'sms', code: '123456' },
4);
5
6result.status; // 'verified'
1$verification = $client->reportVerification(
2 '0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21',
3 DeliveryMethod::Sms,
4 '123456',
5);
6
7$verification->status; // "verified"
8$verification->isVerified(); // true
An incorrect code throws ValidationException with code_invalid (422), and
the verification stays pending for another attempt. Once three attempts are used, the
next report returns status failed.
1let result = try await client.verify(
2 verification,
3 code: "123456"
4)
5
6result.status // .verified
Submit the code through the handle created in Step 3. The existing state collector receives the result.
1handle.submit("123456")
A successful submission emits VerificationState.Submitting followed by
VerificationState.Verified. If the code is rejected, the flow returns to
VerificationState.AwaitingInput with lastError set.
Submit through the controller from Step 3. Nothing throws and nothing returns a
promise: the outcome arrives as a new state.
1controller.submit('123456');
2
3// state.kind moves to 'submitting', then 'verified' or back to
4// 'awaitingInput' with the error attached.
1final finished = await client.reportVerification(
2 started.id,
3 deliveryMethod: started.deliveryMethod,
4 value: const ReportValue.code('123456'),
5);
6
7finished.knownStatus; // VerificationStatus.verified
With VerificationSession, call session.submit(code) instead and read the
result from the state stream.
A status of verified confirms the user controls the number. If the code is incorrect,
the report is rejected and the verification remains available for another attempt until the
attempt limit is reached. See Errors and status codes for
the exact limit and other status values.
Step 5: Check the status (optional)#
Read the current status of a verification at any time. The REST API and the server-side
SDKs make a status request. The on-device SDKs that drive a state machine — Android, React
Native, and Dart with VerificationSession — read the latest state they already hold
rather than issuing a second request.
http
1GET /api/v1/verifications/0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21 HTTP/1.1
2Host: verification-sandbox.didww.com
3Accept: application/json
4Authorization: Basic eW91cl9hcHBfa2V5OnlvdXJfYXBwX3NlY3JldA==
curl
1curl -i -X GET https://verification-sandbox.didww.com/api/v1/verifications/0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21 -H "Accept: application/json" --user your_app_key:your_app_secret
response
1HTTP/1.1 200 OK
2Content-Type: application/json
3
4{
5 "data": {
6 "id": "0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21",
7 "destination": "12015550100",
8 "delivery_method": "sms",
9 "fee": "0.06",
10 "status": "verified",
11 "error_code": null,
12 "error_detail": null,
13 "expires_at": "2026-07-15T10:05:00.000Z",
14 "sms": {
15 "template": "Your code is {{CODE}}",
16 "language": "en-US",
17 "interception_timeout": 300,
18 "code_length": 6
19 }
20 }
21}
1verification = client.get_verification("0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21")
2
3verification.status # => "verified"
4verification.verified? # => true
1verification = client.get_verification("0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21")
2
3verification.status # "verified"
4verification.is_finished # True
is_finished is the signal to stop polling. It is derived from status, so a
status added after the SDK was released is treated as finished rather than polled
forever.
1const current = await client.getVerification(
2 '0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21',
3);
4
5current.status; // 'verified'
1$verification = $client->getVerification('0f9c8b7a-1e2d-4c3b-9a8f-7e6d5c4b3a21');
2
3$verification->status; // "verified"
4$verification->isFinished(); // true
isFinished() is the signal to stop polling. It is true for every status other
than pending, so a status added after the SDK was released is treated as finished
rather than polled forever.
1let current = try await client.status(verification)
2
3current.status // .verified
Do not collect handle.states a second time. Read the latest value mirrored by the
collector created in Step 3:
1when (val current = verificationState.value) {
2 is VerificationState.AwaitingInput -> println("pending")
3 is VerificationState.Verified -> println("verified")
4 is VerificationState.Denied -> println("denied")
5 is VerificationState.Failed -> println("failed")
6 is VerificationState.SetupError -> println("configuration error")
7 VerificationState.Expired -> println("expired")
8 else -> println("in progress")
9}
The controller from Step 3 already holds the current state. Render from it rather than issuing a status request:
1switch (controller.state.kind) {
2 case 'awaitingInput':
3 return <Text>Waiting for the code</Text>;
4 case 'verified':
5 return <Text>Verified</Text>;
6 case 'denied':
7 case 'expired':
8 case 'failed':
9 return <Text>Not verified</Text>;
10 default:
11 return <Text>Please wait...</Text>;
12}
With the client, read the status directly:
1final current = await client.getVerification(started.id);
2
3current.knownStatus; // VerificationStatus.verified
4current.isFinished; // true
With VerificationSession, read session.state or listen to session.states
instead of making a second request.
Move to production#
After the sandbox flow works as expected, configure the integration separately for production:
Sign in to the DIDWW Production User Panel.
Create a new OTP application in the production account and configure its callback URL, minimum authentication mode, verification settings, and SMS settings. See OTP application settings reference.
Copy the key and secret from the production OTP application. Store them separately from the sandbox credentials.
Change the API or SDK environment from sandbox to production:
Integration
Sandbox
Production
REST API
https://verification-sandbox.didww.comhttps://verification.didww.comRuby SDK
env: :sandboxenv: :productionor omitenviOS SDK
environment: .sandboxenvironment: .productionAndroid SDK
environment = Environment.Sandboxenvironment = Environment.ProductionRun a controlled verification using a phone number you can access.
Warning
Production requests can contact real destinations and incur verification and delivery charges. Confirm that the production OTP application, credentials, callback URL, and API environment are configured together before sending requests.
Next steps#
View, edit, or delete your applications, or rotate a secret, in Manage OTP applications.
Look up every application setting in the OTP application settings reference.
Compare the delivery channels in Verification Methods.
Review the available authentication modes and choose the one that fits your integration in Authentication.
Gate verifications in real time with a request callback.
Send OTP SMS from your own sender ID with Sender ID Verifications.
Review every field and status code in the API Reference.