Endpoints年龄验证门

检查年龄验证门

执行年龄验证检查,判断玩家是否可以进入游戏,并在需要时创建年龄挑战。 请在提供玩家所在司法管辖区的同时,提供 `dateOfBirth`、`age` 或 `kuid` 中的且仅一个年龄信号。一个都不提供或提供多个都会导致请求无效。提供 `kuid` 时将使用监护人已登记的年龄,且生成的会话或挑战只会关联到该用户。 响应中的 `status` 决定接下来的操作:`PASS` 会返回会话,玩家可以继续;`CHALLENGE` 会返回需要先完成的挑战;`PROHIBITED` 两者都不返回,因为玩家未达到该产品的最低年龄。 返回挑战中的一次性密码会过期。请在准备展示时再调用 `/challenge/generate-otp`,并在挑战进入进行中状态之前定期重新生成。

POST
/age-gate/check
AuthorizationBearer <token>

In: header

Header Parameters

Kid-Target-Product-Id?integer

Optional header for Account System Products to perform cross-product age gate checks. The value must be the product ID of the target product within the same organization. The target product must not itself be an Account System Product.

Request Body

application/json

检查年龄验证门槛

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/age-gate/check" \  -H "Content-Type: application/json" \  -d '{    "jurisdiction": "US-CA",    "dateOfBirth": "2012-06-15",    "age": 13,    "kuid": "12b9fa0e-6d6d-4903-a1fc-f2233027b71d",    "platformAgeSignal": {      "name": "meta-horizon",      "category": "TN"    },    "subject": {      "id": "id-12345678-1234-1234-1234-123456789012"    },    "options": {      "termsOfServiceDocument": "xbox-tos",      "privacyPolicyDocument": "xbox-privacy-policy",      "additionalLegalLinks": [        "steam-tos",        "xbox-conduct"      ],      "playerAgeAssurance": {        "redirectUrl": "https://example.com/verify/complete"      }    }  }'

{  "status": "PASS",  "session": {    "sessionId": "b1a6482d-5242-4b4a-aa88-3fa52595a672",    "kuid": "12b9fa0e-6d6d-4903-a1fc-f2233027b71d",    "ageStatus": "LEGAL_ADULT",    "ageCategory": "adult",    "etag": "e889efb9e8a985308e82bed78c5aef7f37f50cf36b7337bf654980d0bab7a574",    "status": "ACTIVE",    "dateOfBirth": "2005-04-15",    "jurisdiction": "US-CA",    "managedBy": "PLAYER",    "permissions": [      {        "name": "text-chat-public",        "enabled": false,        "managedBy": "GUARDIAN"      },      {        "name": "text-chat-private",        "enabled": true,        "managedBy": "PLAYER"      },      {        "name": "forums",        "enabled": false,        "managedBy": "PROHIBITED"      }    ]  }}