When developing solutions with Sitefinity Insight, you can inherit and extend any of the .NET SDK clients. To create new clients, use the following abstract classes:
CrudClientBase<T>
CrudAndGetAllClientBase <TAll, T, TId>
DatacenterBoundClientBase
ClientBase
This article demonstrates how to create a client from scratch. The client gets all contacts in Sitefinity Insight and can also get a single contact and their interactions, reported to Sitefinity Insight.
NOTE: In this article, all visitors - both anonymous visitors or contacts who provided their email address, are referred as contacts.
You will need the following classes to create the sample:
To implement the client, you inherit from the DatacenterBoundClientBase abstract class. You use the methods and constructors of the class to make requests to the Sitefinity Insight API Server. The following code sample demonstrates how to implement the client:
The following sample demonstrates how to get twenty contacts from Sitefinity Insight and then get the details and twenty interactions of the first contact:
The following table lists the abstract classes that you can use to extend the .NET SDK, together with their constructors, properties, and methods.
An abstract base class, containing logic for making PUT, POST, DELETE, and GET requests to the Sitefinity Insight API Server.
This abstract class inherits from ClientBase class and provides a basis infrastructure to simplify the implementation of new clients for data center bound operations. You use this class when you want to call a specific API endpoint that requires the data center key as part of the request header. To create advanced abstraction over CRUD (Create, Read, Update, and Modify) operations, or to automatically set restrictions for entities, you use different classes, such as CrudAndGetAllClientBase, described below.
CrudAndGetAllClientBase
public string DatacenterKey { get; private set; }
An abstract class containing methods for creating, retrieving, updating, and deleting all artifacts. Inherits from DataCenterBoundClientBase.
DataCenterBoundClientBase
protected abstract string EntityUrl { get; }
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important