DingSDK 0.20.0
dotnet add package DingSDK --version 0.20.0
NuGet\Install-Package DingSDK -Version 0.20.0
<PackageReference Include="DingSDK" Version="0.20.0" />
<PackageVersion Include="DingSDK" Version="0.20.0" />
<PackageReference Include="DingSDK" />
paket add DingSDK --version 0.20.0
#r "nuget: DingSDK, 0.20.0"
#:package DingSDK@0.20.0
#addin nuget:?package=DingSDK&version=0.20.0
#tool nuget:?package=DingSDK&version=0.20.0
DingSDK
SDK Example Usage
Send a code
Send an OTP code to a user's phone number.
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
CreateAuthenticationRequest req = new CreateAuthenticationRequest() {
CustomerUuid = "cf2edc1c-7fc6-48fb-86da-b7508c6b7b71",
Locale = "fr-FR",
PhoneNumber = "+1234567890",
};
var res = await sdk.Otp.CreateAuthenticationAsync(req);
// handle response
Check a code
Check that a code entered by a user is valid.
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
CreateCheckRequest req = new CreateCheckRequest() {
AuthenticationUuid = "eebe792b-2fcc-44a0-87f1-650e79259e02",
CheckCode = "123456",
CustomerUuid = "64f66a7c-4b2c-4131-a8ff-d5b954cca05f",
};
var res = await sdk.Otp.CheckAsync(req);
// handle response
Perform a retry
Perform a retry if a user has not received the code.
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
RetryAuthenticationRequest req = new RetryAuthenticationRequest() {
AuthenticationUuid = "a4e4548a-1f7b-451a-81cb-a68ed5aff3b0",
CustomerUuid = "28532118-1b33-420a-b57b-648c9bf85fee",
};
var res = await sdk.Otp.RetryAsync(req);
// handle response
Send feedback
Send feedback about the authentication process.
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
FeedbackRequest req = new FeedbackRequest() {
CustomerUuid = "cc0f6c04-40de-448f-8301-3cb0e6565dff",
PhoneNumber = "+1234567890",
Status = FeedbackRequestStatus.Onboarded,
};
var res = await sdk.Otp.FeedbackAsync(req);
// handle response
Get authentication status
Get the status of an authentication.
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
var res = await sdk.Otp.GetAuthenticationStatusAsync(authUuid: "d8446450-f2fa-4dd9-806b-df5b8c661f23");
// handle response
Look up for phone number
Perform a phone number lookup.
using DingSDK;
using DingSDK.Models.Components;
using DingSDK.Models.Requests;
using System.Collections.Generic;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
var res = await sdk.Lookup.LookupAsync(
customerUuid: "69a197d9-356c-45d1-a807-41874e16b555",
phoneNumber: "<value>",
type: new List<DingSDK.Models.Requests.Type>() {
DingSDK.Models.Requests.Type.Cnam,
}
);
// handle response
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
Name | Type | Scheme |
---|---|---|
APIKey |
apiKey | API key |
You can set the security parameters through the security
optional parameter when initializing the SDK client instance. For example:
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
CreateCheckRequest req = new CreateCheckRequest() {
AuthenticationUuid = "eebe792b-2fcc-44a0-87f1-650e79259e02",
CheckCode = "123456",
CustomerUuid = "64f66a7c-4b2c-4131-a8ff-d5b954cca05f",
};
var res = await sdk.Otp.CheckAsync(req);
// handle response
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 DingSDK.Models.Errors.SDKException
exception, which has the following properties:
Property | Type | Description |
---|---|---|
Message |
string | The error message |
StatusCode |
int | The HTTP status code |
RawResponse |
HttpResponseMessage | 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 exceptions. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the CheckAsync
method throws the following exceptions:
Error Type | Status Code | Content Type |
---|---|---|
DingSDK.Models.Errors.ErrorResponse | 400 | application/json |
DingSDK.Models.Errors.SDKException | 4XX, 5XX | */* |
Example
using DingSDK;
using DingSDK.Models.Components;
using DingSDK.Models.Errors;
var sdk = new Ding(security: new Security() {
APIKey = "YOUR_API_KEY",
});
try
{
CreateCheckRequest req = new CreateCheckRequest() {
AuthenticationUuid = "eebe792b-2fcc-44a0-87f1-650e79259e02",
CheckCode = "123456",
CustomerUuid = "64f66a7c-4b2c-4131-a8ff-d5b954cca05f",
};
var res = await sdk.Otp.CheckAsync(req);
// handle response
}
catch (Exception ex)
{
if (ex is ErrorResponse)
{
// Handle exception data
throw;
}
else if (ex is DingSDK.Models.Errors.SDKException)
{
// Handle default exception
throw;
}
}
Server Selection
Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the serverUrl: string
optional parameter when initializing the SDK client instance. For example:
using DingSDK;
using DingSDK.Models.Components;
var sdk = new Ding(
serverUrl: "https://api.ding.live/v1",
security: new Security() {
APIKey = "YOUR_API_KEY",
}
);
CreateCheckRequest req = new CreateCheckRequest() {
AuthenticationUuid = "eebe792b-2fcc-44a0-87f1-650e79259e02",
CheckCode = "123456",
CustomerUuid = "64f66a7c-4b2c-4131-a8ff-d5b954cca05f",
};
var res = await sdk.Otp.CheckAsync(req);
// handle response
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net5.0
- newtonsoft.json (>= 13.0.3)
- nodatime (>= 3.1.9)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.20.0 | 575 | 1/9/2025 |
0.19.68 | 147 | 1/8/2025 |
0.19.67 | 186 | 1/7/2025 |
0.19.66 | 152 | 1/6/2025 |
0.19.65 | 166 | 1/5/2025 |
0.19.64 | 177 | 1/4/2025 |
0.19.63 | 150 | 1/3/2025 |
0.19.36 | 196 | 12/7/2024 |
0.19.35 | 157 | 12/6/2024 |
0.19.34 | 155 | 12/5/2024 |
0.19.33 | 151 | 12/4/2024 |
0.19.32 | 141 | 12/3/2024 |
0.19.31 | 146 | 12/2/2024 |
0.19.30 | 145 | 12/1/2024 |
0.19.29 | 150 | 11/30/2024 |
0.19.28 | 145 | 11/29/2024 |
0.19.27 | 141 | 11/28/2024 |
0.19.26 | 150 | 11/27/2024 |
0.19.25 | 147 | 11/26/2024 |
0.19.24 | 205 | 11/25/2024 |
0.19.23 | 150 | 11/24/2024 |
0.19.22 | 150 | 11/23/2024 |
0.19.21 | 144 | 11/22/2024 |
0.19.20 | 143 | 11/21/2024 |
0.19.19 | 153 | 11/20/2024 |
0.19.18 | 133 | 11/19/2024 |
0.19.17 | 140 | 11/18/2024 |
0.19.16 | 135 | 11/17/2024 |
0.19.15 | 141 | 11/16/2024 |
0.19.14 | 138 | 11/15/2024 |
0.19.13 | 146 | 11/14/2024 |
0.19.12 | 145 | 11/13/2024 |
0.19.11 | 211 | 11/11/2024 |
0.19.10 | 153 | 11/10/2024 |
0.19.9 | 150 | 11/9/2024 |
0.19.8 | 150 | 11/8/2024 |
0.19.7 | 4,830 | 11/7/2024 |
0.19.6 | 154 | 11/6/2024 |
0.19.5 | 147 | 11/5/2024 |
0.19.4 | 166 | 11/4/2024 |
0.19.3 | 157 | 11/3/2024 |
0.19.2 | 152 | 11/2/2024 |
0.19.1 | 146 | 11/1/2024 |
0.19.0 | 147 | 10/31/2024 |
0.18.0 | 158 | 10/30/2024 |
0.17.10 | 484 | 8/6/2024 |
0.17.9 | 166 | 7/26/2024 |
0.17.8 | 199 | 7/23/2024 |
0.17.7 | 155 | 7/17/2024 |
0.17.6 | 156 | 7/11/2024 |
0.17.5 | 322 | 6/22/2024 |
0.17.3 | 172 | 6/14/2024 |
0.17.2 | 274 | 6/4/2024 |
0.17.1 | 169 | 5/30/2024 |
0.17.0 | 157 | 5/29/2024 |
0.16.1 | 189 | 5/23/2024 |
0.16.0 | 142 | 5/14/2024 |
0.15.2 | 155 | 5/8/2024 |
0.15.1 | 127 | 5/3/2024 |
0.15.0 | 160 | 4/30/2024 |
0.14.1 | 320 | 4/24/2024 |
0.14.0 | 176 | 4/12/2024 |
0.13.0 | 166 | 4/2/2024 |
0.12.0 | 178 | 3/28/2024 |
0.11.4 | 184 | 3/22/2024 |
0.11.3 | 180 | 3/20/2024 |
0.11.2 | 178 | 3/16/2024 |
0.11.1 | 182 | 3/13/2024 |
0.11.0 | 179 | 3/12/2024 |
0.10.0 | 190 | 2/22/2024 |
0.9.2 | 172 | 2/17/2024 |
0.9.1 | 172 | 2/15/2024 |
0.9.0 | 179 | 2/6/2024 |
0.8.0 | 168 | 2/1/2024 |
0.7.1 | 174 | 1/19/2024 |
0.7.0 | 228 | 12/12/2023 |
0.6.2 | 191 | 12/1/2023 |
0.6.1 | 200 | 11/18/2023 |
0.6.0 | 184 | 11/16/2023 |
0.5.0 | 162 | 11/15/2023 |