# ABM Restfull API

## Overview <a href="#overview" id="overview"></a>

## HTTP status codes <a href="#overview-http-status-codes" id="overview-http-status-codes"></a>

ABM uses following HTTP status codes.

| Status code                | Usage                                                                                                                                            |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `200 OK`                   | The request was completed successfully.                                                                                                          |
| `201 Created`              | A new resource has been created successfully. The resource’s URI is available from the Location header response.                                 |
| `204 No Content`           | Existing resource has been deleted successfully                                                                                                  |
| `400 Bad Request`          | The request was defined incorrectly. The response body will include further explanations.                                                        |
| `404 Not Found`            | The requested resource does not exist.                                                                                                           |
| `409 Conflict`             | Indicates that the request could not be processed due to the conflict in the request, such as creation of new resource with already existing id. |
| `422 Unprocessable Entity` | The request was well-formed but was unable to be followed due to semantic errors.                                                                |

## Scheme <a href="#overview-scheme" id="overview-scheme"></a>

REST API is availble through HTTPS protocol. All requests must be preceded with /api/v1 prefix. All responses have JSON format.

## Autorization and authentication <a href="#overview-autorization-and-authentication" id="overview-autorization-and-authentication"></a>

Each requst must contain authorization header with acces token:\
-H 'Authorization: Bearer \<ACCES-TOKEN>'

## Resources <a href="#resources" id="resources"></a>

## Data <a href="#resources-data" id="resources-data"></a>

### Import table from .csv file <a href="#resources-data-import-tables-csv" id="resources-data-import-tables-csv"></a>

A `POST` request is used to import .csv file.

#### **Request structure**

#### **Body**

| Path          | Type     | Description                  |
| ------------- | -------- | ---------------------------- |
| `content`     | `String` | .csv file content (required) |
| `fileName`    | `String` | file name (required)         |
| `tableName`   | `String` | table name (required)        |
| `csvSettings` | `Object` | csv file settings (required) |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/data?type=csv' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "content" : "var1,var2,target\\n1,2,1",
  "fileName" : "fileName.csv",
  "tableName" : "tableName1",
  "csvSettings" : {
    "columnSeparator" : ",",
    "decimalSeparator" : ".",
    "textSeparator" : "\\\"",
    "hasHeader" : "true",
    "encoding" : "UTF-8"
  }
}'
```

httpie:

```bash
$ echo '{
  "content" : "var1,var2,target\\n1,2,1",
  "fileName" : "fileName.csv",
  "tableName" : "tableName1",
  "csvSettings" : {
    "columnSeparator" : ",",
    "decimalSeparator" : ".",
    "textSeparator" : "\\\"",
    "hasHeader" : "true",
    "encoding" : "UTF-8"
  }
}' | http POST 'https://e-abm.pl/api/v1/data?type=csv' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Response status should be `200`.

**Example response**

```http
HTTP/1.1 200 OK
```

### Import table from data base <a href="#resources-data-import-tables-db" id="resources-data-import-tables-db"></a>

A `POST` request is used to import file from data base.

#### **Request structure**

#### **Body**

| Path              | Type     | Description                            |
| ----------------- | -------- | -------------------------------------- |
| `sourceTableName` | `String` | name of source table (required)        |
| `tableName`       | `String` | table name in ABM data base (required) |
| `host`            | `String` | data base host (required)              |
| `port`            | `String` | data base port (required)              |
| `catalog`         | `String` | data base catalog (depends on db type) |
| `dbUser`          | `String` | user name (required)                   |
| `dbPassword`      | `String` | password (required)                    |
| `dbType`          | `String` | data base type (required)              |
| `dbName`          | `String` | data base name (depends on db type)    |
| `schema`          | `String` | data base scheme (depends on db type)  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/data?type=db' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "sourceTableName" : "german_credit",
  "tableName" : "tableNameDb",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdbase",
  "dbName" : "",
  "schema" : ""
}'
```

httpie:

```bash
$ echo '{
  "sourceTableName" : "german_credit",
  "tableName" : "tableNameDb",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdbase",
  "dbName" : "",
  "schema" : ""
}' | http POST 'https://e-abm.pl/api/v1/data?type=db' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Response status should be `200`.

#### **Example response**

```http
HTTP/1.1 200 OK
```

### Get list of imported tables <a href="#resources-data-get-list-of-imported-tables-db" id="resources-data-get-list-of-imported-tables-db"></a>

A `GET` request is used to get list of imported tables.

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/data' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/data' 'Accept:*/*'
```

#### **Response structure**

List with names of imported tables. Response status should be `200`.

#### **Example response**

```http
HTTP/1.1 200 OK

[ {
  "tableName" : "tableName1",
  "fileName" : "fileName.csv",
  "importDate" : "2016-10-02"
} ]
```

### Delete table <a href="#resources-data-delete-table" id="resources-data-delete-table"></a>

A `DELETE` request is used to delete table.

#### **Request structure**

The request path contains following parameters:\
./api/v1/data/{tableName}

| Parameter   | Description             |
| ----------- | ----------------------- |
| `tableName` | Name of table to delete |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/data/tableName1' -i -X DELETE -H 'Accept: */*'
```

httpie:

```bash
$ http DELETE 'https://e-abm.pl/api/v1/data/tableName1' 'Accept:*/*'
```

#### **Response structure**

Response status should be `200`.

#### **Example response**

```http
HTTP/1.1 200 OK
```

### Export table to .csv file <a href="#resources-data-export-table-to-csv" id="resources-data-export-table-to-csv"></a>

A `GET` request is used to export table to .csv file.

#### **Request structure**

The request path contains following parameters:\
./api/v1/data/{sourceTableName}

| Parameter         | Description          |
| ----------------- | -------------------- |
| `sourceTableName` | Name of source table |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/data/tableName1?type=csv' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/data/tableName1?type=csv' 'Accept:*/*'
```

#### **Response structure**

Response contains content of .csv file. Response status should be `200`.

### Export table to data base <a href="#resources-data-export-table-to-db" id="resources-data-export-table-to-db"></a>

A `POST` request is used to export table to data base.

#### **Request structure**

The request path contains following parameters:\
./api/v1/data/{sourceTableName}

| Parameter         | Description          |
| ----------------- | -------------------- |
| `sourceTableName` | Name of source table |

#### **Body**

| Path         | Type     | Description                            |
| ------------ | -------- | -------------------------------------- |
| `tableName`  | `String` | table name after export (required)     |
| `host`       | `String` | data base host (required)              |
| `port`       | `String` | data base port (required)              |
| `catalog`    | `String` | data base catalog (depends on db type) |
| `dbUser`     | `String` | user name (required)                   |
| `dbPassword` | `String` | password (required)                    |
| `dbType`     | `String` | data base type (required)              |
| `dbName`     | `String` | data base name (depends on db type)    |
| `schema`     | `String` | data base scheme (depends on db type)  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/data/ABMKDDCupTable?type=db' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "tableName" : "ExportedKDDCupTable",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdBase",
  "dbName" : "",
  "schema" : ""
}'
```

httpie:

```bash
$ echo '{
  "tableName" : "ExportedKDDCupTable",
  "host" : "52.28.103.187",
  "port" : "2159",
  "catalog" : "abm",
  "dbUser" : "",
  "dbPassword" : "",
  "dbType" : "gdBase",
  "dbName" : "",
  "schema" : ""
}' | http POST 'https://e-abm.pl/api/v1/data/ABMKDDCupTable?type=db' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Response status should be `200`.

#### **Example response**

```http
HTTP/1.1 200 OK

{
  "id" : 3,
  "database" : "ABMKDDCupTable",
  "filename" : "1_ABMKDDCupTable",
  "status" : "RUNNING",
  "errorMessage" : null,
  "confirmMessage" : false
}
```

## Projects <a href="#resources-projects" id="resources-projects"></a>

### Creating project <a href="#resources-project-create-project" id="resources-project-create-project"></a>

A `POST` request is used to create project.

#### **Request structure**

#### **Body**

| Path                | Type     | Description                                                   |
| ------------------- | -------- | ------------------------------------------------------------- |
| `name`              | `String` | project name (required)                                       |
| `tableName`         | `String` | table name (required)                                         |
| `processType`       | `String` | Process type ('classification' or 'approximation') (required) |
| `processParameters` | `Object` | Object with process parameters (required)                     |

**processParameters object:**

| Parameter                           | Presence                    | Description                                                                                                                                                                                |
| ----------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| processMethod                       | required                    | Name of a process method. For approximation task "approximation". In case of classification: "quick","advanced" or "gold"                                                                  |
| target                              | required                    | Name of target variable                                                                                                                                                                    |
| positiveTargetValue                 | required for classification | Positive value of target variable (only for classification)                                                                                                                                |
| variableRoles                       | optional                    | List containing names, roles and types for each of variables                                                                                                                               |
| qualityMeasure                      | optional                    | Name of quality measure (for classification): "LIFT", "CAPTURED\_RESPONSE", "PRECISION", "ACCURACY", "RECALL", "ROC\_AREA", "COST". For approximation: "MAE", "MAPE", "RMSE", "R\_SQUARED" |
| cutoff                              | optional                    | Value of percentile for which "LIFT" or "CAPTURED\_RESPONSE" is optimized. (only for classification)                                                                                       |
| samplingMode                        | optional                    | Mode of sampling: "MANUAL", "AUTO\_RRL"                                                                                                                                                    |
| samplingSize                        | optional                    | Size of sample                                                                                                                                                                             |
| samplingStratificationMode          | optional                    | Type of stratification sampling: "NONE", "CONST\_RATIO", "CONST\_NUM", "OVERSAMPLING". (only for classification)                                                                           |
| samplingPositiveTargetCategoryRatio | optional                    | Expected ratio of positive target. (only for classification)                                                                                                                               |
| classificationThreshold             | optional                    | Value of classification threshold. (only for classification)                                                                                                                               |
| classificationThresholdType         | optional                    | Type of setting classification threshold: "MANUAL\_PROBABILITY", "COST\_MATRIX" or "AUTOMATIC". (only for classification)                                                                  |
| profitMatrixOptimized               | optional                    | Wheter values of cost matrix will be calculated automatically based on a-priori probability. (only for classification)                                                                     |
| profitMatrixCurrency                | optional                    | Currency for profit chart. (only for classification)                                                                                                                                       |
| profitMatrixTruePositive            | optional                    | Value of True Positive in profit matrix. (only for classification)                                                                                                                         |
| profitMatrixFalseNegative           | optional                    | Value of False Negative in profit matrix. (only for classification)                                                                                                                        |
| profitMatrixFalsePositive           | optional                    | Value of False Positive in profit matrix. (only for classification)                                                                                                                        |
| profitMatrixTrueNegative            | optional                    | Value of True Negative in profit matrix. (only for classification)                                                                                                                         |
| useTestData                         | optional                    | If false only train and validation table are created, if true: train, validation and test table are created                                                                                |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "name" : "project1",
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}'
```

httpie:

```bash
$ echo '{
  "name" : "project1",
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}' | http POST 'https://e-abm.pl/api/v1/projects' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Response status should be `201`.

#### **Example response**

```http
HTTP/1.1 201 Created

{
  "id" : 2,
  "name" : "project1",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}
```

### Copying project <a href="#resources-project-copy-project" id="resources-project-copy-project"></a>

A `POST` request is used to copy project.

#### **Request structure**

The request path contains following parameters:<br>

| Parameter       | Description          |
| --------------- | -------------------- |
| sourceProjectId | Id of source project |

#### **Body**

| Path          | Type     | Description           |
| ------------- | -------- | --------------------- |
| `projectName` | `String` | Name of a new project |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects?source=1' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "projectName" : "project1Copied"
}'
```

httpie:

```bash
$ echo '{
  "projectName" : "project1Copied"
}' | http POST 'https://e-abm.pl/api/v1/projects?source=1' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Response status should be `201`.

#### **Example response**

```http
HTTP/1.1 201 Created

{
  "id" : 3,
  "name" : "project1Copied",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "gerr",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}
```

### Change project settings <a href="#resources-project-change-project-settings" id="resources-project-change-project-settings"></a>

A `PUT` request is used to change project settings.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/parameters

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Body**

| Path                                  | Type      | Description                                                                                                            |
| ------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------- |
| `processMethod`                       | `String`  | Process method (required)                                                                                              |
| `target`                              | `String`  | Name of target variable (required)                                                                                     |
| `positiveTargetValue`                 | `String`  | Target positive value (only for classification) (required for classification)                                          |
| `variableRoles`                       | `Array`   | List with role for each variable (optional)                                                                            |
| `qualityMeasure`                      | `String`  | Name of quality measure (optional)                                                                                     |
| `cutoff`                              | `Number`  | Value of percentile on which LIFT or CAPTURED\_RESPONSE is optimized (optional)                                        |
| `samplingMode`                        | `String`  | Sampling mode (optional)                                                                                               |
| `samplingSize`                        | `Number`  | Size of sample (optional)                                                                                              |
| `samplingStratificationMode`          | `String`  | Type of a sampling (only for classification) (optional)                                                                |
| `samplingPositiveTargetCategoryRatio` | `Number`  | Expectation value for ratio of positive target (only for classification) (optional)                                    |
| `classificationThreshold`             | `Number`  | Classification treshold (optional)                                                                                     |
| `classificationThresholdType`         | `String`  | Type of selection of classification treshold (optional)                                                                |
| `profitMatrixOptimized`               | `Boolean` | Wheater values of cost matrix will be calculated automatically (optional)                                              |
| `profitMatrixCurrency`                | `String`  | Currency for profit chart (only for classification) (optional)                                                         |
| `profitMatrixTruePositive`            | `Number`  | Value of True Positive (optional)                                                                                      |
| `profitMatrixFalseNegative`           | `Number`  | Value of False Negative (optional)                                                                                     |
| `profitMatrixFalsePositive`           | `Number`  | Value of False Positive (optional)                                                                                     |
| `profitMatrixTrueNegative`            | `Number`  | Value of True Negative (optional)                                                                                      |
| `useTestData`                         | `Boolean` | If false only train and validation table are created, if true: train, validation and test table are created (optional) |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/parameters' -i -X PUT -H 'Accept: */*' -H 'Content-Type: text/plain; charset=ISO-8859-1' -d '{
  "processMethod" : "quick",
  "target" : "Class",
  "positiveTargetValue" : "good",
  "variableRoles" : [ {
    "name" : "var1",
    "role" : "ACTIVE",
    "type" : "NUMERICAL"
  }, {
    "name" : "var2",
    "role" : "ACTIVE",
    "type" : "CATEGORICAL"
  } ],
  "samplingSize" : 30000,
  "samplingStratificationMode" : "CONST_NUM",
  "samplingPositiveTargetCategoryRatio" : 0.5,
  "samplingMode" : "MANUAL",
  "classificationThreshold" : 0.5,
  "cutoff" : 0.1,
  "qualityMeasure" : "LIFT",
  "useTestData" : true,
  "classificationThresholdType" : "MANUAL PROBABILITY",
  "profitMatrixOptimized" : false,
  "profitMatrixCurrency" : "euro",
  "profitMatrixTruePositive" : 1,
  "profitMatrixFalseNegative" : 0,
  "profitMatrixFalsePositive" : 0,
  "profitMatrixTrueNegative" : 1
}'
```

httpie:

```bash
$ echo '{
  "processMethod" : "quick",
  "target" : "Class",
  "positiveTargetValue" : "good",
  "variableRoles" : [ {
    "name" : "var1",
    "role" : "ACTIVE",
    "type" : "NUMERICAL"
  }, {
    "name" : "var2",
    "role" : "ACTIVE",
    "type" : "CATEGORICAL"
  } ],
  "samplingSize" : 30000,
  "samplingStratificationMode" : "CONST_NUM",
  "samplingPositiveTargetCategoryRatio" : 0.5,
  "samplingMode" : "MANUAL",
  "classificationThreshold" : 0.5,
  "cutoff" : 0.1,
  "qualityMeasure" : "LIFT",
  "useTestData" : true,
  "classificationThresholdType" : "MANUAL PROBABILITY",
  "profitMatrixOptimized" : false,
  "profitMatrixCurrency" : "euro",
  "profitMatrixTruePositive" : 1,
  "profitMatrixFalseNegative" : 0,
  "profitMatrixFalsePositive" : 0,
  "profitMatrixTrueNegative" : 1
}' | http PUT 'https://e-abm.pl/api/v1/projects/1/parameters' 'Accept:*/*' 'Content-Type:text/plain; charset=ISO-8859-1'
```

### Get list of all projects <a href="#resources-project-get-projects-list" id="resources-project-get-projects-list"></a>

A `GET` request is used to obtain list of projects.

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects' 'Accept:*/*'
```

#### **Response structure**

Response status should be `200`.

#### **Example response**

```http
HTTP/1.1 200 OK

[ {
  "id" : 3,
  "name" : "project1Copied",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "gerr",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}, {
  "id" : 2,
  "name" : "project1",
  "creationDate" : "2016-10-02",
  "lastRun" : null,
  "tableName" : "dataTable",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "NEW",
  "errorMessage" : null,
  "readOnly" : false
}, {
  "id" : 1,
  "name" : "6b10726ec1504f4ab8e8ac7a2ebc47f1",
  "creationDate" : "2016-10-02",
  "lastRun" : "2016-10-02",
  "tableName" : "gerr",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "qualityMeasure" : "LIFT",
    "cutoff" : 0.1,
    "samplingMode" : "MANUAL",
    "samplingSize" : 30000.0,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "classificationThreshold" : 0.5,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1.0,
    "profitMatrixFalseNegative" : 0.0,
    "profitMatrixFalsePositive" : 0.0,
    "profitMatrixTrueNegative" : 1.0,
    "useTestData" : true
  },
  "signature" : null,
  "status" : "ERROR",
  "errorMessage" : "biz.sc.gornik.common.g: Error during script execution\n\tat biz.sc.gornik.server.g.j.execute(j.java:234)\n\tat biz.sc.gornik.server.a.q.run(q.java:359)\n\tat biz.sc.gornik.server.a.i.run(i.java:85)\n\tat biz.sc.gornik.common.ab.run(ab.java:84)\nCaused by: /gornik/Server/config.current.xml:259: Java returned: 255\n\tat org.apache.tools.ant.taskdefs.Java.execute(Java.java:112)\n\tat org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)\n\tat sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:497)\n\tat org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)\n\tat org.apache.tools.ant.Task.perform(Task.java:348)\n\tat org.apache.tools.ant.Target.execute(Target.java:435)\n\tat org.apache.tools.ant.Target.performTasks(Target.java:456)\n\tat org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)\n\tat org.apache.tools.ant.Project.executeTarget(Project.java:1376)\n\tat biz.sc.gornik.server.g.wb.a(wb.java:176)\n\tat biz.sc.gornik.server.g.wb.run(wb.java:106)\n",
  "readOnly" : false
} ]
```

### Starting and cancelling project <a href="#resources-project-start-and-stop" id="resources-project-start-and-stop"></a>

A `PUT` request is used to start/cancel project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/build

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Body**

| Path     | Type     | Description                                       |
| -------- | -------- | ------------------------------------------------- |
| `action` | `String` | Action to perform: 'start' or 'cancel' (required) |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/build' -i -X PUT -H 'Accept: */*' -H 'Content-Type: text/plain; charset=ISO-8859-1' -d '{
  "action" : "start"
}'
```

httpie:

```bash
$ echo '{
  "action" : "start"
}' | http PUT 'https://e-abm.pl/api/v1/projects/1/build' 'Accept:*/*' 'Content-Type:text/plain; charset=ISO-8859-1'
```

### Check build status of a project <a href="#resources-project-check-build-status" id="resources-project-check-build-status"></a>

A `GET` request is used to check build status of a project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/build

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/build' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects/1/build' 'Accept:*/*'
```

#### **Response structure**

Information about project status

### Deleting project <a href="#resources-project-delete-project" id="resources-project-delete-project"></a>

A `DELETE` request is used to delete project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1' -i -X DELETE -H 'Accept: */*'
```

httpie:

```bash
$ http DELETE 'https://e-abm.pl/api/v1/projects/1' 'Accept:*/*'
```

### Scoring data with model <a href="#resources-project-scoring-data-with-model" id="resources-project-scoring-data-with-model"></a>

A `PUT` request is used for scoring data with model.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/score

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Body**

| Path             | Type     | Description                                                       |
| ---------------- | -------- | ----------------------------------------------------------------- |
| `action`         | `String` | Action to perform: 'start' or 'cancel' (required)                 |
| `inputTable`     | `String` | Name of table with data for scoring (required for 'start' option) |
| `outputTable`    | `String` | Result table name with scored data (required for 'start' option)  |
| `copyColumnList` | `Array`  | List with names of variables to copy (required)                   |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/score' -i -X PUT -H 'Accept: */*' -H 'Content-Type: text/plain; charset=ISO-8859-1' -d '{
  "action" : "start",
  "inputTable" : "KDDCupTable",
  "outputTable" : "scoringOutputTable",
  "copyColumnList" : [ "Class", "age" ]
}'
```

httpie:

```bash
$ echo '{
  "action" : "start",
  "inputTable" : "KDDCupTable",
  "outputTable" : "scoringOutputTable",
  "copyColumnList" : [ "Class", "age" ]
}' | http PUT 'https://e-abm.pl/api/v1/projects/1/score' 'Accept:*/*' 'Content-Type:text/plain; charset=ISO-8859-1'
```

### Checking scoring status of a project <a href="#resources-project-check-scoring-status" id="resources-project-check-scoring-status"></a>

A `GET` request is used for checking status of scoring project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/score

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/score' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects/1/score' 'Accept:*/*'
```

#### **Response structure**

Information about scoring status

### Getting list of modules in project <a href="#resources-project-get-modules-list" id="resources-project-get-modules-list"></a>

A `GET` request is used for getting list of modules in project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/modules

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/modules' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects/1/modules' 'Accept:*/*'
```

#### **Response structure**

List with names of modules for which result is available

### Exporting statistics for all modules in project <a href="#resources-project-statistics-export" id="resources-project-statistics-export"></a>

A `GET` request is used for exporting statistics for all modules in project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/statistics

| Parameter   | Description |
| ----------- | ----------- |
| `projectId` | Project id  |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/statistics' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects/1/statistics' 'Accept:*/*'
```

#### **Response structure**

List of statistics for all modules

### Exporting statistics for selected module in project <a href="#resources-project-module-statistics-export" id="resources-project-module-statistics-export"></a>

A `GET` request is used for exporting statistics for selected module in project.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{projectId}/statistics/{moduleName}

| Parameter    | Description                    |
| ------------ | ------------------------------ |
| `projectId`  | Project id                     |
| `moduleName` | Name of module with statistics |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/statistics/modelStatistics' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects/1/statistics/modelStatistics' 'Accept:*/*'
```

#### **Response structure**

List of statistics for selected module

### Exporting of scoring code in selected language <a href="#resources-project-scoring-code-export" id="resources-project-scoring-code-export"></a>

A `GET` request is used for exporting scoring code.

#### **Request structure**

The request path contains following parameters:<br>

| Parameter | Description                                                                                                   |
| --------- | ------------------------------------------------------------------------------------------------------------- |
| projectId | Project id                                                                                                    |
| dialect   | Name of language for scoring code exporting: JAVA, SQL, SQL\_MSSQL, SQL\_TERADATA, SQL\_ORACLE, SQL\_POSTGRES |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/scoringCode?dialect=JAVA' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/projects/1/scoringCode?dialect=JAVA' 'Accept:*/*'
```

## Models <a href="#resources-models" id="resources-models"></a>

### Creating model in single request <a href="#resources-models-create-models-in-one-request" id="resources-models-create-models-in-one-request"></a>

A `POST` request is used for creating model in single request.

#### **Request structure**

#### **Body**

| Path                 | Type     | Description                                                     |
| -------------------- | -------- | --------------------------------------------------------------- |
| `inputData`          | `Object` | Input data for modelling (required)                             |
| `responseURL`        | `String` | URL where result of modelling will be send (required)           |
| `scoringCodeDialect` | `String` | Language for scoring code (required)                            |
| `processType`        | `String` | Type of process: "classification" or "approximation" (required) |
| `processParameters`  | `Object` | Object with process parameters (required)                       |

**inputData object:**<br>

**Data from data base:**

```
{
    "sourceTableName":"Name of table with data",
    "tableName":"Name of result table",
    "host":"Data base host",
    "port":"Data base port",
    "catalog":"Data base catalog",
    "dbUser":"Name of db user",
    "dbPassword":"password",
    "dbType":"data base type"
}
```

**Data from .csv file:**

```
{
    "content":"Content of .csv file",
    "fileName":"Name of file",
    "tableName":"Name of result table after importing data",
    "csvSettings": {
        "columnSeparator":",",
        "decimalSeparator":".",
        "textSeparator":"\"",
        "hasHeader": "true",
        "encoding":"UTF-8"
    }
}
```

**processParameters object: the same as for creating project**

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/models' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "inputData" : {
    "tableName" : "gerr",
    "content" : "\"checking_status\",\"duration\",\"credit_history\",\"purpose\",\"credit_amount\",\"savings_status\",\"employment\",\"installment_commitment\",\"personal_status\",\"other_parties\",\"residence_since\",\"property_magnitude\",\"age\",\"other_payment_plans\",\"housing\",\"existing_credits\",\"job\",\"num_dependents\",\"own_telephone\",\"foreign_worker\",\"Class\"\n\"less 0\",6,\"critical/other existing credit\",\"radio/tv\",1169,\"no known savings\",\"greater 7\",4,\"male single\",\"none\",4,\"real estate\",67,\"none\",\"own\",2,\"skilled\",1,\"yes\",\"yes\",\"good\"\n\"0 less X less 200\",48,\"existing paid\",\"radio/tv\",5951,\"less 100\",\"1 less X less 4\",2,\"female div/dep/mar\",\"none\",2,\"real estate\",22,\"none\",\"own\",1,\"skilled\",1,\"none\",\"yes\",\"bad\"\n\"no checking\",12,\"critical/other existing credit\",\"education\",2096,\"less 100\",\"4 less X less 7\",2,\"male single\",\"none\",3,\"real estate\",49,\"none\",\"own\",1,\"unskilled resident\",2,\"none\",\"yes\",\"good\"",
    "fileName" : "Mojplik",
    "csvSettings" : {
      "columnsSeparator" : ",",
      "decimalSeparator" : ".",
      "textSeparator" : "\"",
      "hasHeader" : "true",
      "encoding" : "UTF-8"
    }
  },
  "responseURL" : "https://e-abm.pl/api/v1/projects/test",
  "scoringCodeDialect" : "JAVA",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}'
```

httpie:

```bash
$ echo '{
  "inputData" : {
    "tableName" : "gerr",
    "content" : "\"checking_status\",\"duration\",\"credit_history\",\"purpose\",\"credit_amount\",\"savings_status\",\"employment\",\"installment_commitment\",\"personal_status\",\"other_parties\",\"residence_since\",\"property_magnitude\",\"age\",\"other_payment_plans\",\"housing\",\"existing_credits\",\"job\",\"num_dependents\",\"own_telephone\",\"foreign_worker\",\"Class\"\n\"less 0\",6,\"critical/other existing credit\",\"radio/tv\",1169,\"no known savings\",\"greater 7\",4,\"male single\",\"none\",4,\"real estate\",67,\"none\",\"own\",2,\"skilled\",1,\"yes\",\"yes\",\"good\"\n\"0 less X less 200\",48,\"existing paid\",\"radio/tv\",5951,\"less 100\",\"1 less X less 4\",2,\"female div/dep/mar\",\"none\",2,\"real estate\",22,\"none\",\"own\",1,\"skilled\",1,\"none\",\"yes\",\"bad\"\n\"no checking\",12,\"critical/other existing credit\",\"education\",2096,\"less 100\",\"4 less X less 7\",2,\"male single\",\"none\",3,\"real estate\",49,\"none\",\"own\",1,\"unskilled resident\",2,\"none\",\"yes\",\"good\"",
    "fileName" : "Mojplik",
    "csvSettings" : {
      "columnsSeparator" : ",",
      "decimalSeparator" : ".",
      "textSeparator" : "\"",
      "hasHeader" : "true",
      "encoding" : "UTF-8"
    }
  },
  "responseURL" : "https://e-abm.pl/api/v1/projects/test",
  "scoringCodeDialect" : "JAVA",
  "processType" : "classification",
  "processParameters" : {
    "processMethod" : "quick",
    "target" : "Class",
    "positiveTargetValue" : "good",
    "variableRoles" : [ {
      "name" : "var1",
      "role" : "ACTIVE",
      "type" : "NUMERICAL"
    }, {
      "name" : "var2",
      "role" : "ACTIVE",
      "type" : "CATEGORICAL"
    } ],
    "samplingSize" : 30000,
    "samplingStratificationMode" : "CONST_NUM",
    "samplingPositiveTargetCategoryRatio" : 0.5,
    "samplingMode" : "MANUAL",
    "classificationThreshold" : 0.5,
    "cutoff" : 0.1,
    "qualityMeasure" : "LIFT",
    "useTestData" : true,
    "classificationThresholdType" : "MANUAL PROBABILITY",
    "profitMatrixOptimized" : false,
    "profitMatrixCurrency" : "euro",
    "profitMatrixTruePositive" : 1,
    "profitMatrixFalseNegative" : 0,
    "profitMatrixFalsePositive" : 0,
    "profitMatrixTrueNegative" : 1
  }
}' | http POST 'https://e-abm.pl/api/v1/models' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Id of the model

### Getting model status <a href="#resources-model-get-model-status" id="resources-model-get-model-status"></a>

A `GET` request is used for getting model status.

#### **Request structure**

The request path contains following parameters:\
./api/v1/models/{Id}/status

| Parameter | Description |
| --------- | ----------- |
| `Id`      | Model id    |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/models/1/status' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/models/1/status' 'Accept:*/*'
```

#### **Response structure**

Information about status of the model

### Getting model result <a href="#resources-model-get-model-result" id="resources-model-get-model-result"></a>

A `GET` request is used for getting model result.

#### **Request structure**

The request path contains following parameters:\
./api/v1/models/{Id}/result

| Parameter | Description |
| --------- | ----------- |
| `Id`      | Model id    |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/models/1/result' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/models/1/result' 'Accept:*/*'
```

#### **Response structure**

List with signature of the model and scoring code

## Scoring <a href="#resources-scoring" id="resources-scoring"></a>

### Deploying final model to scoring engine <a href="#resources-scoring-deploy-final-model-in-sce" id="resources-scoring-deploy-final-model-in-sce"></a>

A `POST` request is used for deploying final model in scoring engine.

#### **Request structure**

The request path contains following parameters:\
./api/v1/projects/{modelId}/deploy

| Parameter | Description |
| --------- | ----------- |
| `modelId` | Model id    |

#### **Body**

| Path                | Type      | Description                                                                                           |
| ------------------- | --------- | ----------------------------------------------------------------------------------------------------- |
| `overwriteIfExists` | `Boolean` | If false: existing deployed model with the same id will not be overwrited (deafult: false) (required) |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/projects/1/deploy' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "overwriteIfExists" : false
}'
```

httpie:

```bash
$ echo '{
  "overwriteIfExists" : false
}' | http POST 'https://e-abm.pl/api/v1/projects/1/deploy' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

Id of the model in scoring engine

### Deleting model from scoring engine <a href="#deleting_model_from_scoring_engine" id="deleting_model_from_scoring_engine"></a>

A `DELETE` request is used for deleting model from scoring engine.

#### **Request structure**

The request path contains following parameters:\
./api/v1/scoring/{modelId}

| Parameter | Description |
| --------- | ----------- |
| `modelId` | Model id    |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/scoring/1' -i -X DELETE -H 'Accept: */*'
```

httpie:

```bash
$ http DELETE 'https://e-abm.pl/api/v1/scoring/1' 'Accept:*/*'
```

### Scoring data row <a href="#resources-scoring-scoring-data-row" id="resources-scoring-scoring-data-row"></a>

A `POST` request is used for scoring data row.

#### **Request structure**

The request path contains following parameters:\
./api/v1/scoring/{modelId}/score

| Parameter | Description |
| --------- | ----------- |
| `modelId` | Model id    |

#### **Body**

| Path      | Type     | Description                     |
| --------- | -------- | ------------------------------- |
| `dataRow` | `String` | Data row for scoring (required) |

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/scoring/1/score' -i -X POST -H 'Accept: */*' -H 'Content-Type: application/json; charset=UTF-8' -d '{
  "dataRow" : "{ \"col1\": \"value1\", \"col2: \"value2\", \"col3\": \"value3\" }"
}'
```

httpie:

```bash
$ echo '{
  "dataRow" : "{ \"col1\": \"value1\", \"col2: \"value2\", \"col3\": \"value3\" }"
}' | http POST 'https://e-abm.pl/api/v1/scoring/1/score' 'Accept:*/*' 'Content-Type:application/json; charset=UTF-8'
```

#### **Response structure**

List with model id, scoring time, predicted value of target and value of probability for positive target (only for classification)

### Listing models in scoring engine <a href="#resources-scoring-list-models" id="resources-scoring-list-models"></a>

A `GET` request is used for listing models in scoring engine.

#### **Example requests**

curl:

```bash
$ curl 'https://e-abm.pl/api/v1/scoring' -i -H 'Accept: */*'
```

httpie:

```bash
$ http GET 'https://e-abm.pl/api/v1/scoring' 'Accept:*/*'
```

#### **Response structure**

List with names of models in scoring engine


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://algolytics-technologies.gitbook.io/algolytics/algolytics-apis/abm-restfull-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
