Query table reference

Returns the current results of a table reference query.

POST https://moi.matrixorigin.cn/newmoi/catalog/table/ref_list

Preparation before calling

First query the object in the database to obtain the target table ID. Prepare the personal access token, target workspace ID, and table ID that have access to the target workspace.

The example below uses:

  • $AI_STUDIO_API_KEY: The actual personal access token, passed through the X-API-Key Header.

  • $WORKSPACE_ID: Target workspace ID, passed through X-Workspace-ID Header.

  • $TABLE_ID: The referenced table ID to be queried.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/catalog/table/ref_list" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "id": '"$TABLE_ID"'
  }'

Request body

Parameter

Type

Required

Description

id

integer

Yes

Table ID.

Successful response

Returns 200 on success. The current implementation returns an empty array, and this result cannot be used to confirm that the table has no references; the actual result of the delete operation is subject to the delete interface response.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "list": []
  }
}

The response fields are as follows.

Field

Type

Description

code

string

OK on success.

msg

string

OK on success.

data.list

array

It is currently fixed to an empty array and cannot be used to determine whether a reference exists.

Error response

{
  "code": "ErrParamInvalid",
  "msg": "id 无效",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

id is missing or the requested format is invalid.

Pass in a valid table ID.

403

ErrForbidden

The current identity does not have table read permission.

Use credentials with read access, or contact your administrator for authorization.

500

ErrServer

The service cannot read the reference information.

Record the request time and error message and try again; if it continues to fail, contact support.

Follow-up operations

When you need to delete a table, directly call Delete table and process the result according to its response.

Last updated on