View database list

List the databases you have access to. Use a name in the response to view the tables and views in that database.

POST https://moi.matrixorigin.cn/newmoi/meta/db/info

Preparation before calling

Prepare a personal access token and workspace ID that has access to the target workspace. The returned results only include databases accessible by the current identity.

The example below uses $AI_STUDIO_API_KEY as X-API-Key and $WORKSPACE_ID as X-Workspace-ID.

Call example

curl -X POST "https://moi.matrixorigin.cn/newmoi/meta/db/info" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID"

Request body

This interface does not require a request body.

Successful response

{
  "code": 200,
  "data": {
    "result": [
      {
        "db_name": "sales",
        "display_name": "销售数据"
      }
    ],
    "total": 1
  }
}

The response fields are as follows.

Field

Type

Description

code

integer

200 on success.

data.result

array

List of databases that can be read by the current access credentials.

data.result[].db_name

string

Database name.

data.result[].display_name

string

Display name; can be omitted if not set.

data.result[].db_owner

string

Database owner; currently returned may be an empty string.

data.result[].is_internal

boolean

Whether it is a built-in database in the system.

data.result[].is_subscription

boolean

Whether it is a subscription database.

data.result[].has_published

boolean

Whether to contain published data.

data.result[].tables

object

Table metadata object.

data.result[].views

object

View metadata object.

data.total

integer

Number of databases in result.

In field paths, [] denotes each item in an array. For example, items[].name is the name field of each item in the items array.

After getting the database name from data.result[].db_name, use Query table in database to continue viewing the object.

Error response

codeinteger or string
Error code or status.
messagestring
Error message.

Error response example

{
  "code": 503,
  "message": "服务暂不可用"
}

Follow-up operations

Save the identification of the target item, and then query table information.

Last updated on