Batch parse workspace names

Batch resolves names by workspace ID and returns the IDs and names of resolvable items.

POST https://moi.matrixorigin.cn/newmoi/data-share/workspaces/resolve-names

Preparation before calling

Prepare a personal access token with access to the target workspace, the target workspace ID, and a list of workspace IDs to resolve.

The example below uses:

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

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

  • $TARGET_WORKSPACE_ID: The workspace ID whose name is to be resolved.

Request example

curl -X POST "https://moi.matrixorigin.cn/newmoi/data-share/workspaces/resolve-names" \
  -H "X-API-Key: $AI_STUDIO_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["'"$TARGET_WORKSPACE_ID"'"]
  }'

Request body

Parameter

Type

Required

Description

ids

string[]

Yes

A list of workspace IDs whose names are to be resolved.

[] after a type means an array. For example, string[] is an array of strings.

Successful response

Returns 200 and the resolvable workspace name on success.

{
  "code": "OK",
  "msg": "OK",
  "data": {
    "workspaces": [
      {
        "id": "ws-02",
        "name": "分析工作区"
      }
    ]
  }
}

The response fields are as follows.

Field

Type

Description

data.workspaces

array

A list of resolvable workspaces.

data.workspaces[].id

string

Workspace ID.

data.workspaces[].name

string

Workspace name.

In field paths, [] means each item in an array. For example, data.workspaces[].id is the id field of each item in data.workspaces.

Error response

{
  "code": "ErrParamInvalid",
  "msg": "请求参数无效",
  "data": null
}

Common HTTP errors

HTTP status code

error code

Common causes

Recommended actions

400

ErrParamInvalid

Invalid request body format or workspace ID list.

Check ids.

403

ErrPermissionDenied

The current identity is not a valid member of the current workspace.

Use credentials that have workspace access.

500

ErrServer

The server failed to resolve the workspace name.

Try again later.

Last updated on