# 狀態碼

在透過 API 送出 HTTP 請求時，可使用以下狀態碼查看 API 請求成功與否：

## 狀態碼說明

### 正確代碼

| 狀態碼 | 說明     |
| --- | ------ |
| 200 | 請求成功   |
| 201 | 資源成功建立 |

#### 正確回應範例

{% hint style="info" %}
此處為內容示範，不同端點的回傳格式內容可能有差異，請以該端點的說明文件參考為主
{% endhint %}

```json
{
  "count": "integer",
  "next": "string|null",
  "previous": "string|null",
  "results": [
    // 結果回傳內容
  ]
}
```

### 錯誤代碼

| 狀態碼 | 說明     |
| --- | ------ |
| 400 | 請求格式錯誤 |
| 401 | 認證失敗   |
| 403 | 權限不足   |
| 404 | 資源不存在  |
| 500 | 伺服器錯誤  |

#### 錯誤回應範例

#### 400 - 請求錯誤：必填欄位缺失

```javascript
{
  "files": ["This field is required."],
  "filename": ["This field is required."],
  "file": ["This field is required."]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.maiagent.ai/api/preparation/status-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
