> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/chinese-simplified/api-wen-dang-xin-yu/xin-yu-fen-shu-pi-liang.md).

# 信誉分数：批量

\[ 基础 URL: `api.ggwp.com`]

`POST` /users/v1/reputation-score

## **描述**

Reputation Score API 允许您以 CSV 格式获取所有用户的最新信誉分。文件可通过 URL 下载，该 URL 将通过电子邮件、Webhook 订阅，或两者同时返回。除了用户 ID、用户名和当前信誉分之外，CSV 还包含每个用户的正向、负向和互动指标。信誉分由用户在游戏中的行为得出，范围从 150 到 850，数值越低表示越具有攻击性或负面行为。

注意：&#x20;

1. CSV URL 自生成时起 30 分钟内有效。
2. 在用户数量超过 1,000,000 的情况下，数据将分拆到多个 CSV 文件中。

## **参数**

`请求体`：包含以下字段的字典：

* **模式**：CSV 交付方式。支持的值： `全部`, `email`, `webhook`
  * 在选择 `webhook`时，请确保配置 [Webhook](/chinese-simplified/webhook.md) 系统并订阅 [玩家信誉分批量事件](https://docs.ggwp.com/chinese-simplified/api-wen-dang-xin-yu/pages/0c354f86bad42e56982f7b0e2763a5eeaf4d7910#id-6.-player-reputation-score-batch)
* （可选） **email**：用于 CSV 交付的电子邮件 ID，仅在模式为时适用 `全部`/`email`
* （可选） **score\_range：** 返回所有信誉分在输入范围内的玩家。有效输入范围介于 150 到 850 之间。
  * 示例：&#x20;
    * `"score_range": "bw:150-850"`&#x20;
    * `"score_range": "bw:150-250"`&#x20;
    * `"score_range": "bw:550-850"`
* （可选） **sanction\_status** ：用于筛选玩家的处罚状态。此参数可接受多个值。如果传入多个值，API 会在这些值之间采用 OR 运算。
  * 支持的值：
    * `chat_active`
    * `chat_muted`
    * `chat_session_muted`
    * `discord_active`
    * `discord_muted`
    * `game_active`
    * `game_muted`
  * 示例：&#x20;
    * `"sanction_status": "in:'chat_active','game_active'"`&#x20;

示例调用：

```bash
curl --request POST 'https://api.ggwp.com/users/v1/reputation-score' \\
--header 'x-api-key: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
    "mode": "email",
    "email": "abc@xyz.com",
    "score_range": "bw:150-850",
    "sanction_status": "in:'\''chat_muted'\'','\''game_muted'\''"
}'
```

## **输出**

* 200 - 操作成功

```json
{"success": true}
```

* 403
  * 无效或缺失的 API 密钥
* 404
  * 用户无效或缺少 'mode' - 当未找到 mode 时提供
  * 缺少邮箱 ID - 当未提供邮箱 ID 时
  * Webhook 事件未订阅 - 当 reputation-score 的 webhook 未订阅时。
* 500
  * 错误响应。无法获取声誉分

#### 注意：

* 当选择 webhook 作为交付方式时，webhook 响应将具有以下格式：

```
{
  "type": "player-reputation-batch-export",
  "event_id": "<event_id>",
  "created_at": "2024-10-06 16:30:09",
  "data": {
    "csv_urls": [
      "csv_url_1",
      "csv_url_2"
    ]
  }
}
```
