Textkernel.Tx.SDK
3.3.2
Prefix Reserved
dotnet add package Textkernel.Tx.SDK --version 3.3.2
NuGet\Install-Package Textkernel.Tx.SDK -Version 3.3.2
<PackageReference Include="Textkernel.Tx.SDK" Version="3.3.2" />
paket add Textkernel.Tx.SDK --version 3.3.2
#r "nuget: Textkernel.Tx.SDK, 3.3.2"
// Install Textkernel.Tx.SDK as a Cake Addin #addin nuget:?package=Textkernel.Tx.SDK&version=3.3.2 // Install Textkernel.Tx.SDK as a Cake Tool #tool nuget:?package=Textkernel.Tx.SDK&version=3.3.2
tx-dotnet
The official C# SDK for the Textkernel Tx v10 API for resume/CV and job parsing, searching, and matching. Supports .NET Framework 4.6.1+ and .NET Core 2.0+.
Installation
From within Visual Studio:
- Open the Solution Explorer.
- Right-click on a project within your solution.
- Click on Manage NuGet Packages...
- Click on the Browse tab and search for "Textkernel.Tx.SDK" (ensure the Package source dropdown is set to
nuget.org
). - Click on the Textkernel.Tx.SDK package, select the appropriate version in the right-tab and click Install.
Using the .NET Core command-line interface (CLI) tools:
dotnet add package Textkernel.Tx.SDK
Using the NuGet Command Line Interface (CLI):
nuget install Textkernel.Tx.SDK
Using the Package Manager Console:
Install-Package Textkernel.Tx.SDK
Documentation
To view MSDN-style documentation for this SDK, check out our DocFX-generated docs. For the full REST API documentation, information about best practices, FAQs, etc. check out our API docs.
Examples
For full code examples, see here.
Basic Usage
Creating a TxClient
This is the object that you will use to perform API calls. You create it with your account credentials and the TxClient
makes the raw API calls for you. These credentials can be found in the Tx Console. Be sure to select the correct DataCenter
for your account.
Without using dependency injection:
TxClient client = new TxClient(httpClient, new TxClientSettings
{
AccountId = "12345678",
ServiceKey = "abcdefghijklmnopqrstuvwxyz",
DataCenter = DataCenter.US
});
Note that the TxClient uses HttpClient and you should follow Microsoft's recommendations here.
Using dependency injection:
Install the Microsoft.Extensions.Http package from nuget. Where you register your services, add the following code:
builder.Services.AddSingleton(_ => new TxClientSettings
{
AccountId = "12345678",
ServiceKey = "abcdefghijklmnopqrstuvwxyz",
DataCenter = DataCenter.US
};
builder.Services.AddHttpClient<ITxClient, TxClient>();
After injecting your TxClient, you will be able to get it from the service provider:
ITxClient client = serviceProvider.GetRequiredService<ITxClient>();
For self-hosted customers, you can create a DataCenter
object with your custom URL using the constructor provided on that class.
Handling errors and the TxException
Every call to any of the methods in the TxClient
should be wrapped in a try/catch
block. Any 4xx/5xx level errors will cause a TxException
to be thrown. Sometimes these are a normal and expected part of the Tx API. For example, if you have a website where users upload resumes, sometimes a user will upload a scanned image as their resume. Textkernel does not process these, and will return a 422 Unprocessable Entity
response which will throw a TxException
. You should handle any TxException
in a way that makes sense in your application.
Additionally, there are TxUsableResumeException
and TxUsableJobException
which are thrown when some error/issue occurs in the API, but the response still contains a usable resume/job. For example, if you are geocoding while parsing and there is a geocoding error (which happens after parsing is done), the ParsedResume
might still be usable in your application.
How to create a Matching UI session
You may be wondering, "where are the Matching UI endpoints/methods?". We have made the difference between a normal API call (such as Search
) and its equivalent Matching UI call extremely trivial. See the following example:
TxClient client = new TxClient(httpClient, new TxClientSettings
{
AccountId = "12345678",
ServiceKey = "abcdefghijklmnopqrstuvwxyz",
DataCenter = DataCenter.US
});
List<string> indexesToSearch = ...;
FilterCriteria searchQuery = ...;
SearchResponse searchResponse = await client.Search(indexesToSearch, searchQuery);
To generate a Matching UI session with the above Search query, you simply need to call the UI(...)
extension method on the TxClient
object, pass in any UI settings, and then make the same call as above:
MatchUISettings uiSettings = ...;
GenerateUIResponse uiResponse = await client.UI(uiSettings).Search(indexesToSearch, searchQuery);
For every relevant method in the TxClient
, you can create a Matching UI session for that query by doing the same as above.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
For release notes visit https://github.com/textkernel/tx-dotnet/releases