Skip to content

Latest commit

 

History

History
412 lines (301 loc) · 10.3 KB

File metadata and controls

412 lines (301 loc) · 10.3 KB

Table APIs

Get a table
Create a table
Update a table
Get columns of a table
Create a column
Update a column
Delete a column


Get a table

Returns the table at the given table id.

GET /v1/tables/{tableId}

Path parameters

Name Type Description
tableId string The table to request.

Query parameters

The query parameters are not expected.

Request body

The request body must be empty.

Response body

The successful response contains an instance of Table.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables/mt-6239" -X GET -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg"

Response

{
    "id": "mt-6239",
    "name": "publicapitable2",
    "description": "hurhurt",
    "dateCreated": "2020-06-04T07:48:12.707",
    "dateModified": "2020-06-04T07:48:12.707",
    "sizeInBytes": 16384.00,
    "version": 9
}

Create a table

Creates a table, returning the newly created table.

POST /v1/tables

Path parameters

The path parameters are not expected.

Query parameters

The query parameters are not expected.

Request body

The request body must contain an instance of Table. The following fields will be used to create a table.

{ 
  name: string;
  description: string
}
Name Type Description
name string The unique name of the table.
description string The description of the table.

Response body

The successful response contains an instance of Table.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables" -X POST -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg" -H "Content-Type: application/json" -d '{"name": "publicapitable3","description": "hurhurt2"}'

Response

{
    "id": "mt-8239",
    "name": "publicapitable3",
    "description": "archive table",
    "dateCreated": "2020-06-18T00:50:09.323",
    "dateModified": "2020-06-18T00:50:09.323",
    "sizeInBytes": 0.00,
    "version": 2
}

Update a table

Updates table parameters.

POST /v1/tables/{tableId}

Path parameters

Name Type Description
tableId string The id of the table to update.

Query parameters

The query parameters are not expected.

Request body

The request body must contain an instance of Table. One or more of the following fields will be used to update the table.

{ 
  name: string;
  description: string
}
Name Type Description
name string The unique name of the table.
description string The description of the table.

Response body

The successful response contains an instance of Table.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables/mt-8239" -X POST -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg" -H "Content-Type: application/json" -d '{"name": "publicapitable5","description": "hurhurt5"}'

Response

{
    "id": "mt-8239",
    "name": "publicapitable5",
    "description": "hurhurt5",
    "dateCreated": "2020-06-18T00:50:09.323",
    "dateModified": "2020-06-18T00:50:09.323",
    "sizeInBytes": 0.00,
    "version": 2
}

Get columns of a table

Returns a column list of a table.

GET /v1/tables/{tableId}/columns

Path parameters

Name Type Description
tableId string The id of a table to request columns from.

Query parameters

The query parameters are not expected.

Request body

The request body must be empty.

Response body

The successful response contains an array of instances of Column.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables/mt-6239/columns" -X GET -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg"

Response

[
    {
        "name": "_Record_ID",
        "dataType": "Number",
        "defaultValue": null,
        "fieldLength": null,
        "nullable": false
    },
    {
        "name": "colfixed",
        "dataType": "FixedLengthText",
        "defaultValue": null,
        "fieldLength": 255,
        "nullable": true
    },
    {
        "name": "colcreate",
        "dataType": "FixedLengthText",
        "defaultValue": null,
        "fieldLength": 252,
        "nullable": true
    }
]

Create a column

Creates a column in a table, returning the newly created column.

POST /v1/tables/{tableId}/columns/

Path parameters

Name Type Description
tableId string The table id to of a table.

Query parameters

The query parameters are not expected.

Request body

The request body must contain an instance of Column. The following fields will be used to create a column.

{ 
  name: string;
  dataType: TableColumnDataType;
  nullable: boolean;
  fieldLength: number;
  defaultValue: string | number | boolean
}
Name Type Description
name string REQUIRED. The unique name of the column.
dataType TableColumnDataType REQUIRED. ColumnType .
nullable boolean OPTIONAL. Whether the column can accept null values, default is true.
fieldLength number OPTIONAL. Number of characters for 'FixedLengthText' dataType, default is null (which sets fixedLengthText to MAX).
nullable boolean OPTIONAL. Whether the column can accept null values, default is true.
defaultValue string, number, boolean OPTIONAL. The default value for the column, based on dataType.

Response body

The successful response contains an instance of Column.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables/mt-8239/columns" -X POST -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg" -H "Content-Type: application/json" -d '{ "name" : "col4","dataType": "number","defaultValue":5,"nullable":false}'

Response

{ 
  "name": "col4",
  "dataType": "number",
  "defaultValue": 5,
  "fieldLength": null,
  "nullable": false
}

Update a column

Updates table column parameters.

POST /v1/tables/{tableId}/columns/{columnName}

Path parameters

Name Type Description
tableId string The id of a table to update the column for.
ColumnName string The name of the column to update. You may indicate a column with spaces either by url-encoded spaces or '_' e.g. for column space it can be column%20space or column_space.

Query parameters

The query parameters are not expected.

Request body

The request body must contain an instance of Column. One or more of the following fields will be used to update the column.

{ 
  name: string;
  dataType: TableColumnDataType;
  nullable: boolean;
  fieldLength: number;
  defaultValue: string | number | boolean
}
Name Type Description
name string The unique name of the column.
dataType TableColumnDataType ColumnType .
nullable boolean Whether the column can accept null values, default is true.
fieldLength number Number of characters for 'FixedLengthText' dataType, default is null (which sets fixedLengthText to MAX).
nullable boolean Whether the column can accept null values, default is true.
defaultValue string, number, boolean The default value for the column, based on dataType.

Response body

The successful response contains an instance of Column.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables/mt-8239/columns" -X POST -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg" -H "Content-Type: application/json" -d '{ "name" : "col4","dataType": "number","defaultValue":5,"nullable":false}'

Response

{
    "name": "col4",
    "dataType": "TrueFalse",
    "defaultValue": 5,
    "fieldLength": null,
    "nullable": false
}

Delete a column

Deletes a table column.

DELETE /v1/tables/{tableId}/columns/{columnName}

Path parameters

Name Type Description
tableId string The id of a table to delete the column from.
columnName string The name of the column to delete. You may indicate a column with spaces either by url-encoded spaces or '_' e.g. for column space it can be column%20space or column_space.

Query parameters

The query parameters are not expected.

Request body

The request body must be empty.

Response body

The response body is empty.

The error response contains an Error.

Example

Request

curl "https://app.solvexia.com/api/v1/tables/mt-6239/columns/col1" -X DELETE -H "Authorization: Bearer syPHeMY5H--kdRtfpoXTgYFF7LHgVOhIjOQ5QkIvSD68VZvc2_uAew.P07tEVThD5SqNCV_tFwbAg"

Response

200 OK