> 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-shen-su.md).

# API 文档：申诉

## **简介**

GGWP 提供了一个 API，允许玩家在认为处罚适用不公平并希望其被复核或撤销时提交申诉。

## 身份验证

GGWP 使用 API 密钥向已授权用户授予对下方列出的所有 API 端点的安全访问权限。所有请求都必须连同已配置的 API 密钥一起提供以下 HTTP 标头：

`x-api-key: <API_KEY>`

每个 API 密钥：

* 唯一标识你的平台/游戏
* 为本文件中列出的所有 API 提供访问权限
* 对每秒可发出的请求数量有特定限制，并且可能还会对按月可发出的请求数量设定配额
* 应妥善保密，不应与任何未授权的游戏/用户共享
* 一旦丢失，就必须重新生成新的密钥

请联系您的 GGWP 客户经理，以获取 API 密钥，并为您的游戏设置所需的正确速率限制。

## 如何使用你的 API 密钥

以下是使用有效 API 密钥调用生产环境 API 端点的示例（本示例中已将密钥隐藏）：

```bash
curl --request POST 'https://api.ggwp.com/users/v1/appeals' \
--header 'x-api-key: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
        "user_id": "test-user", 
        "channel": "chat", 
        "comment": "错误的处罚"
}'
```

无效的 API 密钥将返回一个 `403` 返回代码。以下是使用无效 API 密钥时的示例响应：

```bash
< HTTP/2 403
< date: Thu, 18 Nov 2021 21:28:27 GMT
< content-type: application/json
< content-length: 23
< x-amzn-requestid: f4361ec6-71bc-478f-98cd-da0fe9df829b
< x-amzn-errortype: ForbiddenException
< x-amz-apigw-id: JBPLRHGjPHcFdbg=
<
* Connection #0 to host api.ggwp.com left intact
{"message":"Forbidden"}* Closing connection 0
```

## 申诉 API

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

`POST` /users/v1/appeals

### **描述**

此 API 端点处理玩家针对某项处罚的申诉。玩家可能认为该处罚没有正当理由，并希望将其减轻或移除。

### **参数**

`body`：包含以下字段的字典：\
(*需要使用 utf-8 编码）*

* **user\_id：** 提交申诉的用户的唯一标识符。

  ```json
  user_id = "anonymous_sessionID"
  ```
* **channel（可选）：** 指示处罚应用于何处。支持的渠道有 `聊天`, `语音`, `游戏` 和 `discord`.
* **comment**：玩家为审核人员提供的针对该处罚的文本消息。&#x20;

示例

```json
{
  "user_id": "test-user", 
  "channel": "chat", 
  "comment": "错误的处罚"
}
```

示例调用：

```bash
curl --request POST 'https://api.ggwp.com/users/v1/appeals' \
--header 'x-api-key: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
        "user_id": "test-user", 
        "channel": "chat", 
        "comment": "错误的处罚"
}'
```

### **输出**

* 200 响应 - 操作成功

```json
{
    "message": "成功"
}
```

* 400
  * 无效的输入 JSON，缺少必需字段。
* 403
  * 无效或缺失的 API 密钥
