# Xác thực / môi trường

## Testing

{% hint style="info" %}
Dữ liệu trong môi trường này sẽ không được lưu trữ lâu dài, phục vụ mục đích thử nghiệm.
{% endhint %}

```
REQUEST / HTTP/1.1
Host: testing-api.ghsv.vn
Content-Type: application/json
Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMTQiLCJicmFuY2giOiJkZW1vLmdoc3Yudm4iLCJzZXNzaW9uIjoxNjUyNDY0MTU4fQ.zBeoadjqMWsJj26VeWoV9vrtPKOhDNriZaAm_IqpQGM
```

## Production

### Khởi tạo Token

{% hint style="info" %}
Token dùng để xác định tài khoản thực hiện các yêu cầu qua API từ đó đồng bộ với hệ thống GHSV.&#x20;
{% endhint %}

![](/files/OqBKz4CFSfPl6QsPJdx1)

```
REQUEST / HTTP/1.1
Host: api.ghsv.vn
Content-Type: application/json
Token: token-cua-ban
```

## Cấu trúc Response chung

* Token không hợp lệ

```json
// Content-Type: application/json
// 403: Unauthorized
{
    "success": false,
    "msg": "Token không hợp lệ."
}
```

* Thao tác thành công

```json
// Content-Type: application/json
// 200: OK
{
    "success": true,
    "msg": ""
    // thông tin khác
}
```

* Thao tác thất bại

```json
// Content-Type: application/json
// 200: OK
{
    "success": false,
    "msg": "nguyên nhân / lý do."
}
```


---

# 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://developer.ghsv.vn/api/xac-thuc-moi-truong.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.
