> ## 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.

# GET (/users/{ownerId}/people/{targetid})

> GET (/users/{ownerId}/people/{targetid})

# GET (/users/{ownerId}/people/{targetid})

通过目标 ID 从调用方的人员集合中获取一位人员。
这些 URI 的域为 `social.xboxlive.com`。

* [备注](#ID4EV)
* [URI 参数](#ID4E5)
* [授权](#ID4EJB)
* [必需的请求标头](#ID4ERC)
* [可选的请求标头](#ID4EQD)
* [请求正文](#ID4EWE)
* [HTTP 状态代码](#ID4EBF)
* [必需的响应标头](#ID4EDH)
* [响应正文](#ID4EQAAC)

## 备注

GET 操作不会修改任何资源,因此无论执行一次或多次,都会产生相同的结果。

## URI 参数

| 参数 | 类型 | 说明 |
| - | - | - |
| ownerId | string | 正在访问其资源的用户的标识符。必须与经过身份验证的用户匹配。可能的值为 "me"、xuid({xuid}) 或 gt({gamertag})。 |
| targetid | string | 正在从所有者的人员列表中检索其数据的用户的标识符,可以是 XBOX 用户 ID (XUID) 或玩家代号。示例值:xuid(2603643534573581)、gt(SomeGamertag)。 |

## 授权

\| 类型 | 是否必需 | 说明 | 缺失时的响应 |
\| --- | --- | --- | --- | --- | --- | --- |
\| XUID | 是 | 调用方持有用户的 XBOX 用户 ID (XUID)。 | 401 Unauthorized |

## 必需的请求标头

\| 标头 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Authorization | String。XBOX LIVE 的授权数据。这通常是经过加密的 XSTS 令牌。示例值:**XBL3.0 x=\<userhash>;\<token>**。 |

## 可选的请求标头

\| 标头 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| X-RequestedServiceVersion | 此请求应指向的 XBOX LIVE 服务的生成名称/编号。仅在验证标头的有效性、身份验证令牌中的声明等的有效性之后,请求才会路由到该服务。默认值:1。 |
\| Accept | String。调用方在响应中接受的 Content-Type。所有响应均为 **application/json**。 |

## 请求正文

此请求正文中未发送任何对象。

## HTTP 状态代码

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

\| 代码 | 原因短语 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| 200 | OK | 成功。 |
\| 400 | Bad Request | 用户 ID 格式错误。 |
\| 403 | Forbidden | 无法从授权标头解析 XUID 声明。 |
\| 404 | Not Found | 在所有者的人员列表中未找到目标用户。 |

## 必需的响应标头

\| 标头 | 类型 | 说明 |
\| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
\| Content-Length | 32 位无符号整数 | 响应正文的字节长度。示例值:22。 |
\| Content-Type | string | 响应正文的 MIME 类型。始终为 **application/json**。 |

## 响应正文

如果调用成功,服务将返回目标人员。请参阅 [Person (JSON)](/zh-CN/reference/live/rest/json/json-person)。

### 示例响应

```cpp theme={null}
{
    "xuid": "2603643534573581",
    "isFavorite": false,
    "isFollowingCaller": false,
    "socialNetworks": ["LegacyXboxLive"]
}
         
```

## 另请参阅

##### 父主题

[/users/{ownerId}/people/{targetid}](/zh-CN/reference/live/rest/uri/people/uri-usersowneridpeopletargetid)


## Related topics

- [Displaying people from the People System](/services/xbox-services/community/people-system/concepts/live-pplsys-displaying-people.md)
- [XblPresenceGetPresenceForSocialGroupAsync](/reference/live/xsapi-c/presence_c/functions/xblpresencegetpresenceforsocialgroupasync.md)
- [Privacy and permissions overview](/services/xbox-services/fundamentals/identity/privacy/live-privacy-overview.md)
- [XblMultiplayerGetActivitiesWithPropertiesForSocialGroupAsync](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayergetactivitieswithpropertiesforsocialgroupasync.md)
- [XblMultiplayerGetActivitiesForSocialGroupAsync](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayergetactivitiesforsocialgroupasync.md)
