Algorithm API Configurations
DataMilk provides a web user interface to allow the configuration of Algorithms. The following API allows developers to access this information programmatically and to incorporate this into their own apps if they wish.
Each Algorithm can be configured and multiple instances of an Algorithm can be used at the same time in different parts of a website for different behavior and for reporting purposes.
Each Algorithm type has its own properties in addition to the generic ones.
export enum AlgorithmType {
PVR = 'PVR',
AIAutoSelect = 'AIAutoSelect',
DataCleaner = 'DataCleaner',
EngagementCounters = 'EngagementCounters',
PredictedTopSeller = 'PredictedTopSeller',
}
export interface APIUsageLimit {
start: Date;
limit: number;
}
export interface APIConfiguration {
apiInstanceId?: string;
title?: string;
description?: string;
usageLimit?: APIUsageLimit;
disabled?: boolean;
deleted?: boolean;
algorithmType: AlgorithmType;
}
getAPIConfigs
The developer can manage API instances which specify what is going to be served, what algorithm is used, and other settings.
export type APIConfigurationGetRequest = DmRequest;
export interface APIConfigurationsGetResponse extends DmResponse {
items: APIConfiguration[];
}
updateAPIConfigs
export interface APIConfigurationsUpdateRequest extends DmRequest {
items: APIConfiguration[];
}
export interface ResponseItem {
id: string;
code: number;
message: string;
}
export type UpdateResponseItem = ResponseItem;
export interface UpdateResponse extends DmResponse {
items: UpdateResponseItem[];
}
export type APIConfigurationsUpdateResponse = UpdateResponse;
newAPIConfigs
export interface APIConfigurationsNewRequest extends DmRequest {
items: APIConfiguration[];
}
export type NewResponseItem = ResponseItem;
export interface NewResponse extends DmResponse {
items: NewResponseItem[];
}
export type APIConfigurationsNewResponse = NewResponse;