Common Model APIs
The latest online API documentation is available at https://api.openmeta.info
The following are common model-level API.
POST copyList
POST /{modelName}/copyList
Copy multiple rows based on ids, and return the new data ids.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
ids | query | array[object] | yes | Data source IDs to be copied. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST copyListAndReturn
POST /{modelName}/copyListAndReturn
Copy multiple rows based on ids, and return the new rows.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
ids | query | array[object] | yes | Data source IDs to be copied. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST copyOne
POST /{modelName}/copyOne
Copy a single row based on id, and return the id of the new row.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data source ID to be copied. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST copyOneAndReturn
POST /{modelName}/copyOneAndReturn
Copy a single row based on id, and return the new row.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data source ID to be copied. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
GET copyWithoutCreate
GET /{modelName}/copyWithoutCreate
Copy one row by id, only return the copyable field values, without inserting into database.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data source ID to be copied. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
GET count
GET /{modelName}/count
Returns a count or group counting based on the specified filter
, groupBy
, and orders
.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
filters | query | array | no | Filters for data to be counted. |
groupBy | query | array[string] | no | Fields for group counts, Return the total count if not specified. |
orders | query | array | no | The field order of the grouped results |
effectiveDate | query | string(date) | no | Effective date for timeline model. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST createList
POST /{modelName}/createList
Create multiple rows and return the id list.
Body Parameters
[
{
"property1": {},
"property2": {}
}
]
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | array[object] | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST createListAndReturn
POST /{modelName}/createListAndReturn
Create multiple rows and return the latest values from database.
Body Parameters
[
{
"property1": {},
"property2": {}
}
]
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | array[object] | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST createOne
POST /{modelName}/createOne
Create a single row and return the id.
Body Parameters
{
"property1": {},
"property2": {}
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | object | no | none |
» additionalProperties | body | object | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST createOneAndReturn
POST /{modelName}/createOneAndReturn
Create one row return the latest values from database.
Body Parameters
{
"property1": {},
"property2": {}
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | object | no | none |
» additionalProperties | body | object | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST deleteList
POST /{modelName}/deleteList
Delete multiple rows by ids.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
ids | query | array[object] | yes | Data IDs to be deleted. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST deleteOne
POST /{modelName}/deleteOne
Delete one row by id. All slices related to this id
will be deleted for timeline model.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data ID to be deleted |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST deleteSlice
POST /{modelName}/deleteSlice
Delete a slice of the timeline model by sliceId
.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
sliceId | query | number | yes | sliceId of the timeline slice data to delete. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
GET getUnmaskedField
GET /{modelName}/getUnmaskedField
Get the original value for masking field.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data ID to be read |
field | query | string | yes | The masking field name to get the original value |
effectiveDate | query | string(date) | no | Effective date for timeline model. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
GET getUnmaskedFields
GET /{modelName}/getUnmaskedFields
Get the original values for multiple masking fields.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data ID to be read |
fields | query | array[string] | yes | The masking field list to get the original values |
effectiveDate | query | string(date) | no | Effective date for timeline model. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
GET readList
GET /{modelName}/readList
Read multiple rows by ids.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
ids | query | array[object] | yes | Data IDs to be read. |
fields | query | array[string] | no | A list of field names to be read. If not specified, it defaults to all visible fields. |
effectiveDate | query | string(date) | no | Effective date for timeline model. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
GET readOne
GET /{modelName}/readOne
Read one row by id.
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
id | query | number | yes | Data ID, number or string type. |
fields | query | array[string] | no | A list of field names to be read. If not specified, it defaults to all visible fields. |
effectiveDate | query | string(date) | no | Effective date for timeline model. |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST searchList
POST /{modelName}/searchList
Get the data list based on the specifiedfields, filters, orders, limitSize, aggFunctions, and subQueries. Default limit to 50.
Body Parameters
{
"aggFunctions": [
"SUM",
"amount"
],
"effectiveDate": "2019-08-24",
"fields": [
"id",
"name"
],
"filters": {},
"groupBy": [],
"orders": [
"name",
"ASC"
],
"pageNumber": 1,
"pageSize": 50,
"splitBy": [],
"subQueries": {},
"summary": true
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | QueryParams | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST searchPage
POST /{modelName}/searchPage
Paging aggregation query parameters, including fields, filters, orders, pageNumber, pageSizegroupBy, aggFunctions, subQueries, etc. Use the backend default value when not specified.
Body Parameters
{
"aggFunctions": [
"SUM",
"amount"
],
"effectiveDate": "2019-08-24",
"fields": [
"id",
"name"
],
"filters": {},
"groupBy": [],
"orders": [
"name",
"ASC"
],
"pageNumber": 1,
"pageSize": 50,
"splitBy": [],
"subQueries": {},
"summary": true
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | QueryParams | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST searchPivot
POST /{modelName}/searchPivot
Get the pivot table data based on the specified fields, filters, orders, groupBy, splitBy.
Body Parameters
{
"aggFunctions": [
"SUM",
"amount"
],
"effectiveDate": "2019-08-24",
"fields": [
"id",
"name"
],
"filters": {},
"groupBy": [],
"orders": [
"name",
"ASC"
],
"pageNumber": 1,
"pageSize": 50,
"splitBy": [],
"subQueries": {},
"summary": true
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | QueryParams | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST searchSimpleAgg
POST /{modelName}/searchSimpleAgg
Pure SUM, AVG, MIN, MAX, COUNT aggregate query, like ["SUM", "amount"]
or [["SUM", "amount"], [], ...]
,
the return key is sumAmount
.
Body Parameters
{
"aggFunctions": [
"SUM",
"amount"
],
"effectiveDate": "2019-08-24",
"filters": {}
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | SimpleQueryParams | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST updateByFilter
POST /{modelName}/updateByFilter
Update data according to the filters, within the current user’s permission scope.
Body Parameters
{
"property1": {},
"property2": {}
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
filters | query | array | no | Data filter to update. |
body | body | object | no | none |
» additionalProperties | body | object | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST updateList
POST /{modelName}/updateList
Update multiple rows by id. Return true on success.
Body Parameters
[
{
"property1": {},
"property2": {}
}
]
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | array[object] | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST updateListAndReturn
POST /{modelName}/updateListAndReturn
Update multiple rows by id, and return the latest values from database.
Body Parameters
[
{
"property1": {},
"property2": {}
}
]
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | array[object] | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST updateOne
POST /{modelName}/updateOne
Update one row by id. Return true on success.
Body Parameters
{
"property1": {},
"property2": {}
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | object | no | none |
» additionalProperties | body | object | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
POST updateOneAndReturn
POST /{modelName}/updateOneAndReturn
Update one row by id, and return the latest values from database.
Body Parameters
{
"property1": {},
"property2": {}
}
Params
Name | Location | Type | Required | Description |
---|---|---|---|---|
modelName | path | string | yes | none |
body | body | object | no | none |
» additionalProperties | body | object | no | none |
Response Examples
200 Response
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Responses
HTTP Status Code | Meaning | Description | Data schema |
---|---|---|---|
200 | OK | none | Inline |
Responses Data Schema
Data Schema
API Response Body
{
"code": 0,
"data": true,
"error": "string",
"message": "string"
}
Attribute
Name | Type | Required | Restrictions | Title | Description |
---|---|---|---|---|---|
code | integer(int32) | false | none | Status Code | |
data | boolean | false | none | Result Data | |
error | string | false | none | Error Message | |
message | string | false | none | Common Message |
AggFunctions
[
"SUM",
"amount"
]
Support multiple aggregation queries:
- []
- [“SUM”, “amount”]
- [[“SUM”, “amount”], [“COUNT”, “id”]]
Attribute
None
Orders
[
"name",
"ASC"
]
Support multiple order conditions:
- []
- [“name”, “ASC”]
- [[“name”, “ASC”], [“sequence”, “DESC”]]
- or string format: “name ASC, sequence DESC”
Attribute
None
SubQuery
{}
Sub queries for relational fields: {fieldName: SubQuery}
Attribute
Name | Type | Required | Restrictions | Title | Description |
---|---|---|---|---|---|
count | boolean | false | none | Only count the sub records, true/false | |
fields | [string] | false | none | Sub query fields. | |
filters | object | false | none | none | |
orders | Orders | false | none | Support multiple order conditions: * [] * [“name”, “ASC”] * [[“name”, “ASC”], [“sequence”, “DESC”]] * or string format: “name ASC, sequence DESC” | |
topN | integer(int32) | false | none | TopN query on OneToMany field, using with orders . |
Filters
[
"name",
"=",
"Tom"
]
Support nested filters, such as [a OR b] AND [c OR d OR [e AND f] OR g]
- []
- [“name”, ”=”, “Tom”]
- [[“name”, ”=”, “Tom”], [“version”, ”=”, “6”]]
- [[“name”, ”=”, “Tom”], “OR”, [“code”, ”=”, “A010”], “OR”, [“version”, ”=”, “2”]]
- [[“name”, ”=”, “Tom”], “OR”, [“code”, ”=”, “A010”]], “AND”, [“version”, ”=”, “2”]]
Attribute
None
QueryParams
{
"aggFunctions": [
"SUM",
"amount"
],
"effectiveDate": "2019-08-24",
"fields": [
"id",
"name"
],
"filters": {},
"groupBy": [],
"orders": [
"name",
"ASC"
],
"pageNumber": 1,
"pageSize": 50,
"splitBy": [],
"subQueries": {},
"summary": true
}
Attribute
Name | Type | Required | Restrictions | Title | Description |
---|---|---|---|---|---|
aggFunctions | AggFunctions | false | none | Support multiple aggregation queries: * [] * [“SUM”, “amount”] * [[“SUM”, “amount”], [“COUNT”, “id”]] | |
effectiveDate | string(date) | false | none | Effective date, default is Today . | |
fields | [string] | false | none | Fields list to get, empty means all fields of the model. | |
filters | object | false | none | none | |
groupBy | [string] | false | none | Fields to group by, empty means no grouping. | |
orders | Orders | false | none | Support multiple order conditions: * [] * [“name”, “ASC”] * [[“name”, “ASC”], [“sequence”, “DESC”]] * or string format: “name ASC, sequence DESC” | |
pageNumber | integer(int32) | false | none | Page number, start from 1, default 1. | |
pageSize | integer(int32) | false | none | Page size, or limit size for searchList, default 50. | |
splitBy | [string] | false | none | Pivot split field list. | |
subQueries | object | false | none | Sub queries for relational fields: {fieldName: SubQuery} | |
» additionalProperties | SubQuery | false | none | Sub queries for relational fields: {fieldName: SubQuery} | |
summary | boolean | false | none | Whether to return the summary result of numeric fields, default no summary. |
SimpleQueryParams
{
"aggFunctions": [
"SUM",
"amount"
],
"effectiveDate": "2019-08-24",
"filters": {}
}
Attribute
Name | Type | Required | Restrictions | Title | Description |
---|---|---|---|---|---|
aggFunctions | AggFunctions | false | none | Support multiple aggregation queries: * [] * [“SUM”, “amount”] * [[“SUM”, “amount”], [“COUNT”, “id”]] | |
effectiveDate | string(date) | false | none | Effective date, default is Today . | |
filters | object | false | none | none |