Download the PHP package ding-live/ding-php without Composer
On this page you can find all versions of the php package ding-live/ding-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ding-php
Ding PHP SDK
The Ding PHP library provides convenient access to the Ding API from applications written in the PHP language.
SDK Installation
Composer
SDK Example Usage
SDK Example Usage
Send a code
Send an OTP code to a user's phone number.
Check a code
Check that a code entered by a user is valid.
Perform a retry
Perform a retry if a user has not received the code.
Send feedback
Send feedback about the authentication process.
Get authentication status
Get the status of an authentication.
Look up for phone number
Perform a phone number lookup.
Available Resources and Operations
Available methods
### [lookup](docs/sdks/lookup/README.md) * [lookup](docs/sdks/lookup/README.md#lookup) - Look up for phone number ### [otp](docs/sdks/otp/README.md) * [check](docs/sdks/otp/README.md#check) - Check a code * [createAuthentication](docs/sdks/otp/README.md#createauthentication) - Send a code * [feedback](docs/sdks/otp/README.md#feedback) - Send feedback * [getAuthenticationStatus](docs/sdks/otp/README.md#getauthenticationstatus) - Get authentication status * [retry](docs/sdks/otp/README.md#retry) - Perform a retrySummary
Ding: The OTP API allows you to send authentication codes to your users using their phone numbers.
Table of Contents
- SDK Installation
- SDK Example Usage
- Available Resources and Operations
- Error Handling
- Server Selection
SDK Installation
The SDK relies on Composer to manage its dependencies.
To install the SDK and add it as a dependency to an existing composer.json file:
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\SDKException exception, which has the following properties:
| Property | Type | Description |
|---|---|---|
$message |
string | The error message |
$statusCode |
int | The HTTP status code |
$rawResponse |
?\Psr\Http\Message\ResponseInterface | The raw HTTP response |
$body |
string | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the check method throws the following exceptions:
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\SDKException | 4XX, 5XX | */* |
Example
Server Selection
Server Selection
Select Server by Index
You can override the default server globally by passing a server index to the server_idx: int optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
| # | Server | Variables |
|---|---|---|
| 0 | https://api.ding.live/v1 |
None |
Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!
All versions of ding-php with dependencies
guzzlehttp/guzzle Version ^7.0
speakeasy/serializer Version ^4.0.0
brick/date-time Version ^0.7.0
phpdocumentor/type-resolver Version ^1.8
brick/math Version ^0.12.1