ABBYY.DocumentAI
0.0.5
dotnet add package ABBYY.DocumentAI --version 0.0.5
NuGet\Install-Package ABBYY.DocumentAI -Version 0.0.5
<PackageReference Include="ABBYY.DocumentAI" Version="0.0.5" />
<PackageVersion Include="ABBYY.DocumentAI" Version="0.0.5" />
<PackageReference Include="ABBYY.DocumentAI" />
paket add ABBYY.DocumentAI --version 0.0.5
#r "nuget: ABBYY.DocumentAI, 0.0.5"
#:package ABBYY.DocumentAI@0.0.5
#addin nuget:?package=ABBYY.DocumentAI&version=0.0.5
#tool nuget:?package=ABBYY.DocumentAI&version=0.0.5
ABBYY.DocumentAI
SDK Example Usage
Example
using ABBYY.DocumentAI;
using ABBYY.DocumentAI.Schemas.Components;
using ABBYY.DocumentAI.Schemas.Requests;
var sdk = new DocumentAI(apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>");
ListDocumentsResponse? res = await sdk.Documents.ListAsync(
cursor: "xyz",
limit: 10
);
while(res != null)
{
// handle items
res = await res.Next!();
}
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
ApiKeyAuth |
http | HTTP Bearer |
To authenticate with the API the ApiKeyAuth parameter must be set when initializing the SDK client instance. For example:
using ABBYY.DocumentAI;
using ABBYY.DocumentAI.Schemas.Components;
using ABBYY.DocumentAI.Schemas.Requests;
var sdk = new DocumentAI(apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>");
ListDocumentsResponse? res = await sdk.Documents.ListAsync(
cursor: "xyz",
limit: 10
);
while(res != null)
{
// handle items
res = await res.Next!();
}
Pagination
Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the
returned response object will have a Next method that can be called to pull down the next group of results. If the
return value of Next is null, then there are no more pages to be fetched.
Here's an example of one such pagination call:
using ABBYY.DocumentAI;
using ABBYY.DocumentAI.Schemas.Components;
using ABBYY.DocumentAI.Schemas.Requests;
var sdk = new DocumentAI(apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>");
ListDocumentsResponse? res = await sdk.Documents.ListAsync(
cursor: "xyz",
limit: 10
);
while(res != null)
{
// handle items
res = await res.Next!();
}
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 ABBYY.DocumentAI.Schemas.Errors.APIException exception, which has the following properties:
| Property | Type | Description |
|---|---|---|
Message |
string | The error message |
Request |
HttpRequestMessage | The HTTP request |
Response |
HttpResponseMessage | The HTTP response |
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 ListAsync method throws the following exceptions:
| Error Type | Status Code | Content Type |
|---|---|---|
| ABBYY.DocumentAI.Schemas.Errors.BadRequestError | 400 | application/json |
| ABBYY.DocumentAI.Schemas.Errors.UnauthorizedError | 401 | application/json |
| ABBYY.DocumentAI.Schemas.Errors.TooManyRequestsError | 429 | application/json |
| ABBYY.DocumentAI.Schemas.Errors.InternalServerError | 500 | application/json |
| ABBYY.DocumentAI.Schemas.Errors.APIException | 4XX, 5XX | */* |
Example
using ABBYY.DocumentAI;
using ABBYY.DocumentAI.Schemas.Components;
using ABBYY.DocumentAI.Schemas.Errors;
using ABBYY.DocumentAI.Schemas.Requests;
var sdk = new DocumentAI(apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>");
try
{
ListDocumentsResponse? res = await sdk.Documents.ListAsync(
cursor: "xyz",
limit: 10
);
while(res != null)
{
// handle items
res = await res.Next!();
}
}
catch (Exception ex)
{
if (ex is BadRequestError)
{
// Handle exception data
throw;
}
else if (ex is UnauthorizedError)
{
// Handle exception data
throw;
}
else if (ex is TooManyRequestsError)
{
// Handle exception data
throw;
}
else if (ex is InternalServerError)
{
// Handle exception data
throw;
}
else if (ex is ABBYY.DocumentAI.Schemas.Errors.APIException)
{
// Handle default exception
throw;
}
}
Server Selection
Override Server URL Per-Client
The default server can be overridden globally by passing a URL to the serverUrl: string optional parameter when initializing the SDK client instance. For example:
using ABBYY.DocumentAI;
using ABBYY.DocumentAI.Schemas.Components;
using ABBYY.DocumentAI.Schemas.Requests;
var sdk = new DocumentAI(
serverUrl: "https://api.abbyy.com/document-ai",
apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>"
);
ListDocumentsResponse? res = await sdk.Documents.ListAsync(
cursor: "xyz",
limit: 10
);
while(res != null)
{
// handle items
res = await res.Next!();
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net8.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.