(otp)
Send OTP codes to your users using their phone numbers.
Check a code
declare(strict_types=1);
require 'vendor/autoload.php';
use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;
$security = 'YOUR_API_KEY';
$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();
$request = new Shared\CreateCheckRequest(
authenticationUuid: 'eebe792b-2fcc-44a0-87f1-650e79259e02',
checkCode: '123456',
customerUuid: '64f66a7c-4b2c-4131-a8ff-d5b954cca05f',
);
$response = $sdk->otp->check(
request: $request
);
if ($response->createCheckResponse !== null) {
// handle response
}
?Operations\CheckResponse
Error Type |
Status Code |
Content Type |
Errors\SDKException |
4XX, 5XX |
*/* |
Send a code
declare(strict_types=1);
require 'vendor/autoload.php';
use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;
$security = 'YOUR_API_KEY';
$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();
$request = new Shared\CreateAuthenticationRequest(
customerUuid: 'cf2edc1c-7fc6-48fb-86da-b7508c6b7b71',
phoneNumber: '+1234567890',
locale: 'fr-FR',
);
$response = $sdk->otp->createAuthentication(
request: $request
);
if ($response->createAuthenticationResponse !== null) {
// handle response
}
?Operations\CreateAuthenticationResponse
Error Type |
Status Code |
Content Type |
Errors\SDKException |
4XX, 5XX |
*/* |
Send feedback
declare(strict_types=1);
require 'vendor/autoload.php';
use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;
$security = 'YOUR_API_KEY';
$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();
$request = new Shared\FeedbackRequest(
customerUuid: 'cc0f6c04-40de-448f-8301-3cb0e6565dff',
phoneNumber: '+1234567890',
status: Shared\FeedbackRequestStatus::Onboarded,
);
$response = $sdk->otp->feedback(
request: $request
);
if ($response->feedbackResponse !== null) {
// handle response
}
Parameter |
Type |
Required |
Description |
$request |
Shared\FeedbackRequest |
✔️ |
The request object to use for the request. |
?Operations\FeedbackResponse
Error Type |
Status Code |
Content Type |
Errors\SDKException |
4XX, 5XX |
*/* |
Get authentication status
declare(strict_types=1);
require 'vendor/autoload.php';
use Ding\DingSDK;
$security = 'YOUR_API_KEY';
$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();
$response = $sdk->otp->getAuthenticationStatus(
authUuid: 'd8446450-f2fa-4dd9-806b-df5b8c661f23'
);
if ($response->authenticationStatusResponse !== null) {
// handle response
}
Parameter |
Type |
Required |
Description |
authUuid |
string |
✔️ |
N/A |
?Operations\GetAuthenticationStatusResponse
Error Type |
Status Code |
Content Type |
Errors\SDKException |
4XX, 5XX |
*/* |
Perform a retry
declare(strict_types=1);
require 'vendor/autoload.php';
use Ding\DingSDK;
use Ding\DingSDK\Models\Shared;
$security = 'YOUR_API_KEY';
$sdk = DingSDK\Ding::builder()->setSecurity($security)->build();
$request = new Shared\RetryAuthenticationRequest(
authenticationUuid: 'a4e4548a-1f7b-451a-81cb-a68ed5aff3b0',
customerUuid: '28532118-1b33-420a-b57b-648c9bf85fee',
);
$response = $sdk->otp->retry(
request: $request
);
if ($response->retryAuthenticationResponse !== null) {
// handle response
}
?Operations\RetryResponse
Error Type |
Status Code |
Content Type |
Errors\SDKException |
4XX, 5XX |
*/* |