> ## Documentation Index
> Fetch the complete documentation index at: https://www.bazhuayu.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 读取草稿

> 读回草稿的原文、文件、版本号与校验结果，供「继续编辑」回填。

## 端点

```
GET https://api-datahub.bazhuayu.com/v1/data-apps/{app_id}/workspace
```

认证：需要 API Key，且仅 App 作者（发布者本人）可调用；其他人得到 `404`。

manifest 原文、随附文件、版本号和当前校验结果，是前端「继续编辑」的回填来源。

没有草稿时返回 `404 workspace-not-found`。这是主路径上的正常状态（新 App，或已发布且没有进行中的修改），不是故障，客户端应当显式处理而不是当作服务端错误。

## 请求

### 路径参数

<ParamField path="app_id" type="string" required>
  App 引用。
</ParamField>

### 示例请求

```bash theme={null}
curl \
  -H "Authorization: Bearer $BAZHUAYU_API_KEY" \
  "https://api-datahub.bazhuayu.com/v1/data-apps/carol/reviews-query/workspace"
```

## 响应

### 200 成功

```json theme={null}
{
  "data": {
    "app_name": "probe-b",
    "app_id": "app_6dfe4e839ccf",
    "namespace": "carol",
    "manifest": "\nspec_version: \"0.2\"\nidentity:\n  app_name: probe-b\n  name: 运行列表测试源\n  summary: 运行列表分页与筛选用例的测试 App\n  type: data\n  version:…",
    "files": {},
    "revision": 1,
    "valid": true,
    "issues": [],
    "content_hash": "267d174fa14b05d66608cbd8315242f4b0f5b0b62a5fd94ffa852ee6cf62f978",
    "created_at": "2026-09-15T07:45:38.574191+00:00",
    "updated_at": "2026-09-15T07:45:38.574191+00:00"
  }
}
```

响应包在 `data` 字段中，其内容如下。

<ResponseField name="app_name" type="string" required>
  应用名。
</ResponseField>

<ResponseField name="app_id" type="string" required>
  App 的稳定标识。
</ResponseField>

<ResponseField name="namespace" type="string">
  发布者用户名。
</ResponseField>

<ResponseField name="manifest" type="string" required>
  manifest 原文。
</ResponseField>

<ResponseField name="files" type="object">
  随附文件。
</ResponseField>

<ResponseField name="revision" type="integer" required>
  草稿版本号，用于保存时的 `expected_revision`。
</ResponseField>

<ResponseField name="valid" type="boolean" required>
  是否通过校验。
</ResponseField>

<ResponseField name="issues" type="object[]">
  问题清单。

  <Expandable title="字段">
    <ResponseField name="path" type="string" required>
      —
    </ResponseField>

    <ResponseField name="message" type="string" required>
      —
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="content_hash" type="string">
  内容哈希，与 Build 的 `content_hash` 对应。
</ResponseField>

<ResponseField name="created_at" type="string">
  创建时间。
</ResponseField>

<ResponseField name="updated_at" type="string">
  最近保存时间。
</ResponseField>

### 错误

| HTTP | `code` | `category` | 说明 |
| - | - | - | - |
| 401 | `unauthorized` | `forbidden` | 缺少或无效的 API Key。 |
| 404 | `workspace-not-found` | `not_found` | 该 App 没有进行中的草稿。这是主路径上的正常状态，不是故障。 |

错误响应统一为 `{"error": {code, category, message, retryable}}`，见<a href="/docs/zh/datahub/api/reference/introduction#错误" target="_blank" rel="noopener noreferrer">错误</a>。

## 客户端库

Python 与 JavaScript SDK 暂未封装此端点，请直接调用 REST。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.