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

# POST (/system/strings/validate)

> POST (/system/strings/validate)

# POST (/system/strings/validate)

接受一个字符串数组进行验证,并返回一个大小相同的结果数组。
这些 URI 的域为 `client-strings.xboxlive.com`。

* [备注](#ID4EV)
* [必需的请求标头](#ID4EIB)
* [请求正文](#ID4ELC)
* [HTTP 状态代码](#ID4E4C)
* [响应正文](#ID4ETF)

## 备注

每个结果指示对应的字符串在 XBOX LIVE 上是否可接受,并在适用时包含违规字符串。

相同的字符串始终产生相同的结果。如果收到不成功的结果,请分析该结果并相应地修改字符串。

> **注意:**\
> 生成的 **VerifyStringResult** 仅报告字符串中的第一个违规词。字符串中可能还有其他违规词。如果计划替换违规词以使字符串可用,则应替换该违规词或子字符串,然后重新验证字符串以查找其他违规子字符串。

## 必需的请求标头

\| 标头 | 说明 |
\| --- | --- | --- |
\| Authorization | 身份验证令牌。示例:XBL3.0 x=\[hash];\[token]。 |
\| x-xbl-contract-version | 整数 API 协定版本。对于此 API,必须为 1 或 2。 |

## 请求正文

请求正文是一个字符串数组,数组大小无限制,每个字符串 512 个字符。

### 请求示例

```cpp theme={null}
{
    "stringstoVerify":
    [
        "Poppycock",
        "The quick brown fox jumped over the lazy dog.",
        "Hey, want to play games together?",
        "oh noes"
    ]
}
      
```

## HTTP 状态代码

服务针对使用此方法对此资源发出的请求,返回本节中的某个状态代码。有关与 XBOX Live 服务一同使用的标准 HTTP 状态代码的完整列表,请参见 [标准 HTTP 状态代码](https://devdocs.xbox.com/zh-CN/reference/live/rest/additional/httpstatuscodes)。

\| 代码 | 原因短语 | 说明 |
\| --- | --- | --- | --- | --- | --- |
\| 200 | OK | 所有字符串均已成功处理。这不一定意味着所有字符串都具有正的 HResult。 |
\| 401 | Unauthorized | 请求需要用户身份验证。 |
\| 403 | Forbidden | 不允许该用户或服务发出请求。 |
\| 406 | Not Acceptable | 缺少 **Content-type: application/json** 标头。 |
\| 408 | Request Timeout | 服务无法理解格式错误的请求。通常是无效参数。 |

## 响应正文

返回一个 [VerifyStringResult (JSON)](https://devdocs.xbox.com/zh-CN/reference/live/rest/json/json-verifystringresult) 数组,大小与请求数组相同。

## 另请参阅

##### 父主题

[/system/strings/validate](https://devdocs.xbox.com/zh-CN/reference/live/rest/uri/stringserver/uri-systemstringsvalidate)


## Related topics

- [Validate Entity Token](https://devdocs.xbox.com/api-reference/authentication/validate-entity-token.md)
- [Validate Api Policy](https://devdocs.xbox.com/api-reference/authentication/validate-api-policy.md)
- [Validate IOS Receipt](https://devdocs.xbox.com/api-reference/platform-specific-methods/validate-ios-receipt.md)
- [Validate Windows Store Receipt](https://devdocs.xbox.com/services/playfab/api-references/rest/client/platform-specific-methods/validate-windows-store-receipt.md)
- [Validate Amazon IAP Receipt](https://devdocs.xbox.com/services/playfab/api-references/rest/client/platform-specific-methods/validate-amazon-iap-receipt.md)
