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

# XblSocialGetSocialRelationshipsAsync

> XblSocialGetSocialRelationshipsAsync

# XblSocialGetSocialRelationshipsAsync

获取与调用方存在社交联系的人物列表。

## 语法

```cpp theme={null}
HRESULT XblSocialGetSocialRelationshipsAsync(  
         XblContextHandle xboxLiveContext,  
         uint64_t xboxUserId,  
         XblSocialRelationshipFilter socialRelationshipFilter,  
         size_t startIndex,  
         size_t maxItems,  
         XAsyncBlock* async  
)  
```

### 参数

*xboxLiveContext*   \_In\_\
类型：[XblContextHandle](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

使用 XblContextCreateHandle 创建的 XBOX Live 上下文句柄。

*xboxUserId*   \_In\_\
类型：uint64\_t

要获取其社交关系的 XBOX 用户 ID。

*socialRelationshipFilter*   \_In\_\
类型：[XblSocialRelationshipFilter](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/enums/xblsocialrelationshipfilter.md)

控制列表的筛选方式。

*startIndex*   \_In\_\
类型：size\_t

控制结果列表的起始索引。

*maxItems*   \_In\_\
类型：size\_t

结果列表最多可包含的项数。传递 0 以尝试检索所有项。

*async*   \_In\_\
类型：XAsyncBlock\*

调用方分配的 [XAsyncBlock](https://docs.xbox.com/zh-CN/reference/system/xasync/structs/xasyncblock.md)。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 备注

调用 [XblSocialGetSocialRelationshipsResult](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsresult.md) 以获取结果。

## REST 调用

V1 GET /users/{ownerId}/people?view={view}\&startIndex={startIndex}\&maxItems={maxItems}

## 要求

**头文件：** social\_c.h

**库：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另请参阅

[social\_c](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/social_c_members.md)


## Related topics

- [XblSocialGetSocialRelationshipsResult](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsresult.md)
- [XblSocialRelationshipFilter](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/enums/xblsocialrelationshipfilter.md)
- [social_c](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/social_c_members.md)
- [XblSocialRelationshipResultGetTotalCount](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultgettotalcount.md)
- [XblSocialRelationshipResultGetNextAsync](https://docs.xbox.com/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultgetnextasync.md)
