Endpoints

We have released five endpoints in the first version of our REST API

GET /connections

{{baseURL}}/connections

Returns a list of all your connection including their ID. Such as the following example data:

{
    "data": [
        {
            "id": 66,
            "name": "Trustpilot",
            "description": "",
            "connector": {
                "id": 5,
                "name": "Trustpilot",
                "descripion": "Trustpilot"
            },
            "databaseId": 1,
            "user": {
                "id": 1,
                "name": "Team Less",
                "email": "admin@less.tech"
            },
            "folder": {
                "id": 8,
                "name": "Test"
            }
        }
    ]
}

"folder": null indicates the root workspace folder

GET /datamodels

{{baseURL}}/datamodels

Returns a list of all your models including their ID. Such as the following example data:

{
    "data": [
        {
            "id": 74,
            "name": "Automated Financial Analysis",
            "description": "",
            "user": {
                "id": 1,
                "name": "Team Less",
                "email": "admin@less.tech"
            },
            "folder": null
        }
    ]
}

"folder": null indicates the root workspace folder

GET /datamodels/{id}

{{baseURL}}/datamodels/{id}

The endpoint returns the full documentation of your model: every configuration of every tool present on the canvas including custom annotations. The response looks like this:

{
    "data": {
        "id": 74,
        "name": "Automated Financial Analysis",
        "description": "",
        "user": {
            "id": 1,
            "name": "Team Less",
            "email": "admin@less.tech"
        },
        "folder": null,
        "model": {
            "id": 235,
            "nodes": [
                {
                    "id": "0",
                    "name": "Input",
                    "configuration": {
                        "label": "Exercise_accounts",
                        "value": "Exercise_accounts",
                        "type": "Connection",
                        "source": "Exercise: Automated Financial Analysis",
                        "source_id": 137,
                        "db_id": 1,
                        "tableId": "Exercise_accounts",
                        "dbId": 1
                    }
                },
                {
                    "id": "1",
                    "name": "Input",
                    "configuration": {
                        "label": "Exercise_generalLedger",
                        "value": "Exercise_generalLedger",
                        "type": "Connection",
                        "source": "Exercise: Automated Financial Analysis",
                        "source_id": 137,
                        "db_id": 1,
                        "tableId": "Exercise_generalLedger",
                        "dbId": 1
                    }
                },
                {
                    "id": "2",
                    "name": "Change Columns",
                    "configuration": {
                        "dataframe": "1",
                        "columnNames": [
                            {
                                "column": "EntryNo",
                                "id": "EntryNo",
                                "new": false,
                                "select": false,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Decimal (Float)",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Date",
                                "id": "Date",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "String",
                                    "Type": "String"
                                },
                                "format": "Datetime(time_unit='ns', time_zone=None)"
                            },
                            {
                                "column": "Territory_key",
                                "id": "Territory_key",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Integer",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Account_key",
                                "id": "Account_key",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Integer",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Details",
                                "id": "Details",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "String",
                                    "Type": "String"
                                }
                            },
                            {
                                "column": "Amount",
                                "id": "Amount",
                                "new": false,
                                "select": true,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Integer",
                                    "Type": "Number"
                                }
                            },
                            {
                                "column": "Payment",
                                "id": "Payment",
                                "new": false,
                                "select": false,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "String",
                                    "Type": "String"
                                }
                            },
                            {
                                "column": "execution_time",
                                "id": "execution_time",
                                "new": false,
                                "select": false,
                                "name": null,
                                "missing": false,
                                "originalFormat": {
                                    "Name": "Datetime",
                                    "Type": "Date"
                                }
                            }
                        ],
                        "customAnnotation": "Testing custom annotation"
                    }
                },
                {
                    "id": "3",
                    "name": "Date Format",
                    "configuration": {
                        "dataframe": "2",
                        "columnName": "Date",
                        "columnNames": {
                            "year": true
                        }
                    }
                },
                {
                    "id": "4",
                    "name": "Group By",
                    "configuration": {
                        "dataframe": "3",
                        "groupby": {
                            "Date_year": true,
                            "Details": true,
                            "Account_key": true
                        },
                        "columnNamesAgg": [
                            {
                                "column": "Amount",
                                "aggregation": "sum",
                                "label": "Aggregation"
                            }
                        ]
                    }
                },
                {
                    "id": "5",
                    "name": "Text Column",
                    "configuration": {
                        "dataframe": "4",
                        "columnName": "Column Name",
                        "columnConfig": "\"Y\"+[Date_year]"
                    }
                },
                {
                    "id": "6",
                    "name": "Pivot",
                    "configuration": {
                        "dataframe": "5",
                        "header": "Column Name",
                        "value": "sum_Amount",
                        "aggfunc": "sum",
                        "keyfields": {
                            "Details": true,
                            "Account_key": true
                        }
                    }
                }
            ],
            "version": 3
        }
    }
}

That model looks like this on the canvas. As you can see, the response is equivalent to a JSON-based representation of the model. You can use this endpoint for documentation without having to write and update documentation or for testing purposes (for instance by tracking Combine, Stack or Filter input vs. output dataset)

GET /{assetType}/{id}/execute

{{baseURL}}/{assetType}/{ID}/execution

Get connection ID from the GET /connections endpoint. Run/updates the connection.

AssetType is either connections or datamodels whereby your URL could look like this for a connection:

test.less.tech/api/public/connections/54/execute

Returns a job status message on in which you can see that the container_status (i.e. job status) is set to Pending whereby it is added to your job queue:

{
    "data": {
        "id": 1206,
        "connection_id": 66,
        "container_status": "PENDING",
        "run_code": null,
        "records_retrieved": null,
        "error description": null
    }
}

GET /{assetType}/status/{task_id}

{{baseURL}}/{assetType}/status/{task_id}

Check the status of a job. Can for instance be used to create your own orchestration workflows.

{task_id} refers to the id returned in the GET /{assetType}/{id}/execute response. With the example from above the URL would be structured like this:

{{baseURL}}/connections/status/1206

It returns the status of a specific job at the time of calling the endpoint. In other words, it is an asynchronous call (no promise structure while the asset runs/updates). The response looks identical to the previous call:

{
    "data": {
        "id": 1206,
        "connection_id": 66,
        "container_status": "STOPPED",
        "run_code": 200,
        "records_retrieved": 5484,
        "error description": null
    }
}

Note that as the asset runs/updates, the container_status and the run_code will change. The container_status can be either: pending (in queue), running (updating) or stopped (finished). The run_code can either by 200 (success) or 500 (error).

Last updated