Data collection clients
The following article lists .NET SDK data collection clients, along with their constructors, methods, and some sample code.
RECOMMENDATION: We recommend using
InteractionClient to report sentences, metadata (both subject and object), and mappings to Insight since version 1.1.5 of the .NET SDK.
- public InteractionClient(string datacenterKey)
This is your default choice for instantiating the InteractionClient. You need to provide the API Key of the data center you wish to report data to. The client automatically targets the default live instance of the United States Insight API Server.
- public InteractionClient(string serverAddress, string datacenterKey)
This constructor takes an additional server address parameter, making it possible to target a Insight API Server different than the default United States one.
- public Task<IImportResult> ImportInteractions(string dataSource, IEnumerable<Interaction> interactions)
Used to report a collection of interactions under the provided data source.
- public Task<IImportResult> ImportInteraction(string dataSource, Interaction interaction)
Used to report a single interaction under the provided data source.
The example below demonstrates how to report a sentence, subject, and object metadata, and a mapping with single interaction to the website data source. Note that the client does not require you to authenticate:
You can also send multiple interactions, for example, metadata and mapping without explicit feature (predicate and object) action specified in them:
IMPORTANT: The Sentence client API is included in the latest versions of SDK for backwards compatibility only. We recommend replacing the sentence client with the new
Subject mapping client
The Subject mapping client is included in the latest versions of the SDK for backward compatibility only. We recommend replacing the subject mapping client with the new