The API controller’s task is to accept and handle the custom data source API requests from Flexmonster Pivot. To simplify the request handling, Flexmonster.DataServer.Core.dll
provides a set of ready-to-use methods that allow getting fields, members, and aggregated data. These methods belong to the DLL's IApiService
class.
This guide contains the following sections:
The GetFields()
method returns a list of all fields with their types (see the response to the /fields request). This method has two signatures:
Schema GetFields(string index)
GetFields
with this signature has the same parameter as the /fields request. Schema GetFields(FieldsRequest request)
request
parameter has the FieldsRequest
type. FieldsRequest
is a predefined class from the DLL that describes the /fields request’s structure. Schema
is a class that describes the structure of the response to the /fields request.
The GetMembers()
method returns a list of all field members (see the response to the /members request). This method has the following signatures:
MembersResponse GetMembers(string index, Field field, int page, LogicFilter filter, [IEnumerable<ServerFilter> serverFilter])
index
, field
, filter
, and page
are the same parameters as in the /members request. serverFilter
is an optional parameter containing the server filters.MembersResponse GetMembers(MembersRequest membersRequest, [IEnumerable<ServerFilter> serverFilter])
membersRequest
has the MembersRequest
type. MembersRequest
is a predefined class from the DLL that describes the /members request’s structure. serverFilter
is an optional parameter containing the server filters.MembersResponse GetMembers(MembersRequest membersRequest, ServerFilter serverFilter)
membersRequest
has the MembersRequest
type. MembersRequest
is a predefined class from the DLL that describes the /members request’s structure. serverFilter
contains the server filters.MembersResponse is a class that describes the structure of the response to the /members request.
The GetAggregatedData()
method returns the aggregated data (see the response to the /select request). This method has the following signatures:
SelectResponse GetAggregatedData(string index, Query query, int page, [IEnumerable<ServerFilter> serverFilter])
index
, query
, and page
are the same parameters as in the /select request. serverFilter
is an optional parameter containing the server filters.SelectResponse GetAggregatedData(SelectRequest selectRequest, [IEnumerable<ServerFilter> serverFilter])
selectRequest
has the type SelectRequest
. SelectRequest
is a predefined class from the DLL that describes the /select request's structure. serverFilter
is an optional parameter containing the server filters.SelectResponse GetAggregatedData(SelectRequest selectRequest, ServerFilter serverFilter)
selectRequest
has the type SelectRequest
. SelectRequest
is a predefined class from the DLL that describes the /select request's structure. serverFilter
contains the server filter.SelectResponse
is a class that describes the structure of the response to the /select request.
Note The DLL’s methods and classes can be overridden and adjusted to your needs.
You may be interested in the following articles: