Query the source database table¶
Paginated queries for the current identity can be used to create published source database tables.
GET https://moi.matrixorigin.cn/newmoi/data-share/source-databases/{source_database_id}/tables
Preparation before calling¶
First query the database list to obtain the source database ID. Prepare a personal access token with access to the target workspace, the target workspace ID, and the source database ID.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed throughX-Workspace-IDHeader.$SOURCE_DATABASE_ID: Source database ID, which must be a canonical string of positive integers.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/data-share/source-databases/$SOURCE_DATABASE_ID/tables?page=1&page_size=20" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Source database ID. |
Query parameters¶
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
integer |
No |
Page number. |
|
integer |
No |
Quantity per page. |
Successful response¶
On success, 200 and the publishable table of the current page are returned.
{
"code": "OK",
"msg": "OK",
"data": {
"list": [
{
"id": "101",
"name": "orders"
}
],
"total": 1,
"page": 1,
"page_size": 20
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
array |
Tables that can be published on the current page. |
|
string |
Stable identification of the MatrixOne table. |
|
string |
Table name. |
|
integer |
The total number of matching tables. |
|
integer |
Current page number. |
|
integer |
Number per page. |
In field paths, [] means each item in an array. For example, data.list[].id is the id field of each item in data.list.
Error response¶
{
"code": "ErrParamInvalid",
"msg": "请求参数无效",
"data": null
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The source database ID or paging parameter is invalid. |
Check path and query parameters. |
|
|
The current identity does not have permission to read the source database or table. |
Use credentials with read permissions. |
|
|
The source database or table no longer exists or cannot be matched. |
Refresh the source database and table list and try again. |
|
|
The server failed to query the source table. |
Try again later. |