# HTTP Response

### 400 BAD REQUEST[​](https://developers.antbuddy.com/bot/http-response#400-bad-request) <a href="#id-400-bad-request" id="id-400-bad-request"></a>

#### Lỗi chưa truyền vào giá trị của các key bắt buộc[​](https://developers.antbuddy.com/bot/http-response#l%C3%B4%CC%83i-ch%C6%B0a-truy%C3%AA%CC%80n-va%CC%80o-gia%CC%81-tri%CC%A3-cu%CC%89a-ca%CC%81c-key-b%C4%83%CC%81t-bu%C3%B4%CC%A3c) <a href="#loi-chua-truyen-vao-gia-tri-cua-cac-key-bat-buoc" id="loi-chua-truyen-vao-gia-tri-cua-cac-key-bat-buoc"></a>

```
Method: POST
Status : 400 BAD REQUEST
Body:
{
    "key": [
        "Trường này là bắt buộc."
    ]
}
```

#### Truyền không đúng lựa chọn của giá trị[​](https://developers.antbuddy.com/bot/http-response#truy%C3%AA%CC%80n-kh%C3%B4ng-%C4%91u%CC%81ng-l%C6%B0%CC%A3a-cho%CC%A3n-cu%CC%89a-gia%CC%81-tri%CC%A3) <a href="#truyen-khong-dung-lua-chon-cua-gia-tri" id="truyen-khong-dung-lua-chon-cua-gia-tri"></a>

Ví dụ: Truyền vào giá trị 'en23' thay vì 'en' trong key 'language'

```
Method: POST
Status : 400 BAD REQUEST
Body:
{
    "key": [
        "A valid {type} is required."
    ]
}
```

#### Truyền không đúng định dạng của giá trị[​](https://developers.antbuddy.com/bot/http-response#truy%C3%AA%CC%80n-kh%C3%B4ng-%C4%91u%CC%81ng-%C4%91i%CC%A3nh-da%CC%A3ng-cu%CC%89a-gia%CC%81-tri%CC%A3) <a href="#truyen-khong-dung-dinh-dang-cua-gia-tri" id="truyen-khong-dung-dinh-dang-cua-gia-tri"></a>

Xảy ra khi truyền vào không đúng kiểu giá trị

```
Method: POST
Status : 400 BAD REQUEST
Body:
{
    "key": [
        "\"{value}\" is not a valid {choices}."
    ]
}
```

### 401 UNAUTHORIZED[​](https://developers.antbuddy.com/bot/http-response#401-unauthorized) <a href="#id-401-unauthorized" id="id-401-unauthorized"></a>

#### Lỗi thiếu access token[​](https://developers.antbuddy.com/bot/http-response#l%C3%B4%CC%83i-thi%C3%AA%CC%81u-access-token) <a href="#loi-thieu-access-token" id="loi-thieu-access-token"></a>

**Chưa thêm vào access token**[**​**](https://developers.antbuddy.com/bot/http-response#ch%C6%B0a-th%C3%AAm-va%CC%80o-access-token)

Authorization type : Bearer Token

```
Method: GET, POST, DELETE, PUT
Status : 401 UNAUTHORIZED
Body:
{
    "detail": "Authentication credentials were not provided."
}
```

#### Sai định dạng của token[​](https://developers.antbuddy.com/bot/http-response#sai-%C4%91i%CC%A3nh-da%CC%A3ng-cu%CC%89a-token) <a href="#sai-dinh-dang-cua-token" id="sai-dinh-dang-cua-token"></a>

**Xảy ra khi thêm hoặc thiếu kí tự trong token**[**​**](https://developers.antbuddy.com/bot/http-response#xa%CC%89y-ra-khi-th%C3%AAm-ho%C4%83%CC%A3c-thi%C3%AA%CC%81u-ki%CC%81-t%C6%B0%CC%A3-trong-token)

Authorization type : Bearer Token

```
Method: GET, POST, DELETE, PUT
Status : 401 UNAUTHORIZED
Body:
{
    "detail": "Error decoding signature."
}
```

### 404 NOT FOUND[​](https://developers.antbuddy.com/bot/http-response#404-not-found) <a href="#id-404-not-found" id="id-404-not-found"></a>

#### Thao tác data không tồn tại thông qua id trên đường dẫn[​](https://developers.antbuddy.com/bot/http-response#thao-ta%CC%81c-data-kh%C3%B4ng-t%C3%B4%CC%80n-ta%CC%A3i-th%C3%B4ng-qua-id-tr%C3%AAn-%C4%91%C6%B0%C6%A1%CC%80ng-d%C3%A2%CC%83n) <a href="#thao-tac-data-khong-ton-tai-thong-qua-id-tren-duong-dan" id="thao-tac-data-khong-ton-tai-thong-qua-id-tren-duong-dan"></a>

Example: /rest-api/phonebook/{id}

```
Method: GET, POST, DELETE, PUT
Status : 404 NOT FOUND
Body:
{
    "detail": "Not found."
}
```


---

# 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.antbuddy.com/huong-dan-tich-hop-api-team-technical-api-integration-guide-technical-team/antbot/http-response.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.
