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

# 简介

> 了解通用概念、响应码和认证策略。

## 基础 URL

Legitmark API 基于 REST 原则构建。我们在每个请求中强制使用 HTTPS 以提高数据安全性、完整性和隐私性。API 不支持 HTTP。
所有请求包含以下基础 URL：

```
https://api.legitmark.com
```

## 认证

在所有请求的 `Authorization` 标头中包含您的 API 密钥：

```javascript theme={null}
const headers = {
  'Authorization': 'Bearer leo_xxxxxxxxx',
  'Content-Type': 'application/json'
};
```

请参阅完整的[认证设置](/cn/partner/authentication)指南，了解注册和安全要求。

## 响应格式

### 成功响应

所有成功的 API 响应遵循此结构：

```json theme={null}
{
  "success": true,
  "message": "操作成功完成",
  "data": {
    // snake_case 格式的响应数据
  },
  "metadata": {
    // 分页元数据（用于列表端点）
    "total_count": 100,
    "page_number": 1,
    "total_pages": 10,
    "page_size": 10
  }
}
```

## 分页

列表端点支持使用查询参数进行分页：

* `page_number`：页码（默认：1，最小值：1）
* `page_size`：每页项目数（默认：20，最大值：100）
* `sort_by`：排序字段
* `sort_direction`：排序方向（`asc` 或 `desc`）

示例：

```
GET /api/users?page_number=1&page_size=20&sort_by=created_at&sort_direction=desc
```

## 数据格式

* 所有请求和响应数据使用 **snake\_case** 格式
* 日期采用 ISO 8601 格式（例如，`2024-01-01T00:00:00.000Z`）
* 使用 UUID 作为资源标识符
* 时间戳包含 `created_at` 和 `updated_at` 字段

## 内容类型

* 请求 Content-Type：`application/json`
* 响应 Content-Type：`application/json`
* 所有请求必须包含正确的 Content-Type 标头
