Overview

HTTP verbs

RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP verbs.

Verb Usage

GET

Used to retrieve a resource

POST

Used to create a new resource

PUT

Used to update an existing resource

DELETE

Used to delete an existing resource

RESTful notes tries to adhere as closely as possible to standard HTTP and REST conventions in its use of HTTP status codes.

Status code Usage

200 OK

The request completed successfully

201 Created

A new resource has been created successfully. The resource’s URI is available from the response’s Location header

204 No Content

An update to an existing resource has been applied successfully

400 Bad Request

The request was malformed. The response body will include an error providing further information

404 Not Found

The requested resource did not exist

Hypermedia

RESTful Notes uses hypermedia and resources include links to other resources in their responses. Responses are in Hypertext Application from resource to resource. Language (HAL) format. Links can be found beneath the _links key. Users of the API should not create URIs themselves, instead they should use the above-described links to navigate

B2METRIC AI Web Service Documentation

Db Source Related Operations

The Db Source entry point into the service.

Get All Db Sources

A GET request is a used get all to access the db source.

Request structure
GET /db-source/all HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 268

[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"name":"Name","sourceId":1,"tableName":"demoTable","description":"Description","serviceName":"Service Name","companyIdentifier":"b2metric","filePath":"/Users","fileType":"csv"}]
CURL request
$ curl 'HTTPS://api2.b2metric.com/db-source/all' -i -X GET \
    -H 'Content-Type: application/json'

Create Db Source

A POST request is a used to access the db source create.

Request structure
POST /db-source HTTP/1.1
Content-Length: 293
Content-Type: application/json
Host: api2.b2metric.com

{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"name":null,"sourceId":null,"tableName":null,"description":"Your Description","serviceName":null,"companyIdentifier":"b2metric","filePath":"Your file path","fileType":"Your file type (csv, txt or etc.)"}
Example response
HTTP/1.1 200 OK
Content-Length: 293
Content-Type: application/json;charset=UTF-8

{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"name":null,"sourceId":null,"tableName":null,"description":"Your Description","serviceName":null,"companyIdentifier":"b2metric","filePath":"Your file path","fileType":"Your file type (csv, txt or etc.)"}
CURL request
$ curl 'HTTPS://api2.b2metric.com/db-source' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"name":null,"sourceId":null,"tableName":null,"description":"Your Description","serviceName":null,"companyIdentifier":"b2metric","filePath":"Your file path","fileType":"Your file type (csv, txt or etc.)"}'

Delete the Db Source

A DELETE request is used to access the db source delete.

Request structure
DELETE /db-source/1 HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Path Parameters
Table 1. /db-source/{id}
Parameter Description

id

To be deleted db source id.

Example response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 2

OK
CURL request
$ curl 'HTTPS://api2.b2metric.com/db-source/1' -i -X DELETE \
    -H 'Content-Type: application/json'

Get the Db Source

A GET request is used to access the db source.

Request structure
GET /db-source/1 HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Path Parameters
Table 2. /db-source/{id}
Parameter Description

id

The wanted displayed db source id.

Example response
HTTP/1.1 200 OK
Content-Length: 293
Content-Type: application/json;charset=UTF-8

{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"name":null,"sourceId":null,"tableName":null,"description":"Your Description","serviceName":null,"companyIdentifier":"b2metric","filePath":"Your file path","fileType":"Your file type (csv, txt or etc.)"}
CURL request
$ curl 'HTTPS://api2.b2metric.com/db-source/1' -i -X GET \
    -H 'Content-Type: application/json'

Experiment Related Operations

The experiment entry point into the service.

Get All Experiments

A GET request is a used get all to access the experiments.

Request structure
GET /experiment/all HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1129

[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"resultScore":0.89,"models":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":1,"modelType":{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":11,"type":"Type","params":{},"desc":"DESC","isActive":true,"title":"Title","genre":"Genre","iconPath":"Icon Path"},"additionalParams":{},"accuracyRate":0.98,"errorDetail":"Error details","isFailed":true}],"selectedInputs":[1],"selectedTask":12,"clusterValue":"Cluster Value","taskType":"CLUSTER","status":"STARTED","companyIdentifier":"b2metric","userId":123,"targetFieldName":"Target Field","targetFeedName":"Target","matchedForeignKeys":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":14,"masterFieldId":97,"slaveFieldId":23,"masterFieldName":"Master field","slaveFieldName":"Field","masterFeedId":98,"slaveFeedId":124}],"experimentFeedsEntityList":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"feedId":87,"feedName":"Feed"}],"wsId":null}]
CURL request
$ curl 'HTTPS://api2.b2metric.com/experiment/all' -i -X GET \
    -H 'Content-Type: application/json'

Create Experiment

A POST request is a used to access the experiment create.

Request structure
POST /experiment HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Content-Length: 1127

{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"resultScore":0.89,"models":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":1,"modelType":{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":11,"type":"Type","params":{},"desc":"DESC","isActive":true,"title":"Title","genre":"Genre","iconPath":"Icon Path"},"additionalParams":{},"accuracyRate":0.98,"errorDetail":"Error details","isFailed":true}],"selectedInputs":[1],"selectedTask":12,"clusterValue":"Cluster Value","taskType":"CLUSTER","status":"STARTED","companyIdentifier":"b2metric","userId":123,"targetFieldName":"Target Field","targetFeedName":"Target","matchedForeignKeys":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":14,"masterFieldId":97,"slaveFieldId":23,"masterFieldName":"Master field","slaveFieldName":"Field","masterFeedId":98,"slaveFeedId":124}],"experimentFeedsEntityList":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"feedId":87,"feedName":"Feed"}],"wsId":null}
Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1127

{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"resultScore":0.89,"models":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":1,"modelType":{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":11,"type":"Type","params":{},"desc":"DESC","isActive":true,"title":"Title","genre":"Genre","iconPath":"Icon Path"},"additionalParams":{},"accuracyRate":0.98,"errorDetail":"Error details","isFailed":true}],"selectedInputs":[1],"selectedTask":12,"clusterValue":"Cluster Value","taskType":"CLUSTER","status":"STARTED","companyIdentifier":"b2metric","userId":123,"targetFieldName":"Target Field","targetFeedName":"Target","matchedForeignKeys":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":14,"masterFieldId":97,"slaveFieldId":23,"masterFieldName":"Master field","slaveFieldName":"Field","masterFeedId":98,"slaveFeedId":124}],"experimentFeedsEntityList":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"feedId":87,"feedName":"Feed"}],"wsId":null}
CURL request
$ curl 'HTTPS://api2.b2metric.com/experiment' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"resultScore":0.89,"models":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":1,"modelType":{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":11,"type":"Type","params":{},"desc":"DESC","isActive":true,"title":"Title","genre":"Genre","iconPath":"Icon Path"},"additionalParams":{},"accuracyRate":0.98,"errorDetail":"Error details","isFailed":true}],"selectedInputs":[1],"selectedTask":12,"clusterValue":"Cluster Value","taskType":"CLUSTER","status":"STARTED","companyIdentifier":"b2metric","userId":123,"targetFieldName":"Target Field","targetFeedName":"Target","matchedForeignKeys":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":14,"masterFieldId":97,"slaveFieldId":23,"masterFieldName":"Master field","slaveFieldName":"Field","masterFeedId":98,"slaveFeedId":124}],"experimentFeedsEntityList":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"feedId":87,"feedName":"Feed"}],"wsId":null}'

Delete the Experiment

A DELETE request is used to access the experiment delete.

Request structure
DELETE /experiment/1 HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Path Parameters
Table 3. /experiment/{id}
Parameter Description

id

To be deleted experiment id.

Example response
HTTP/1.1 200 OK
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 2

OK
CURL request
$ curl 'HTTPS://api2.b2metric.com/experiment/1' -i -X DELETE \
    -H 'Content-Type: application/json'

Get the Experiment

A GET request is used to access the experiment.

Request structure
GET /experiment/1 HTTP/1.1
Content-Type: application/json
Host: api2.b2metric.com
Path Parameters
Table 4. /experiment/{id}
Parameter Description

id

The wanted displayed experiment id.

Example response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 1127

{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"resultScore":0.89,"models":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":1,"modelType":{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":11,"type":"Type","params":{},"desc":"DESC","isActive":true,"title":"Title","genre":"Genre","iconPath":"Icon Path"},"additionalParams":{},"accuracyRate":0.98,"errorDetail":"Error details","isFailed":true}],"selectedInputs":[1],"selectedTask":12,"clusterValue":"Cluster Value","taskType":"CLUSTER","status":"STARTED","companyIdentifier":"b2metric","userId":123,"targetFieldName":"Target Field","targetFeedName":"Target","matchedForeignKeys":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":14,"masterFieldId":97,"slaveFieldId":23,"masterFieldName":"Master field","slaveFieldName":"Field","masterFeedId":98,"slaveFeedId":124}],"experimentFeedsEntityList":[{"createdDate":null,"lastModifiedDate":null,"createdBy":null,"responseMsg":null,"id":null,"feedId":87,"feedName":"Feed"}],"wsId":null}
CURL request
$ curl 'HTTPS://api2.b2metric.com/experiment/1' -i -X GET \
    -H 'Content-Type: application/json'