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

# 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](/reference/live/xsapi-c/types_c/handles/xblcontexthandle)

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

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

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

*socialRelationshipFilter*   \_In\_\
类型：[XblSocialRelationshipFilter](/reference/live/xsapi-c/social_c/enums/xblsocialrelationshipfilter)

控制列表的筛选方式。

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

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

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

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

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

调用方分配的 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 备注

调用 [XblSocialGetSocialRelationshipsResult](/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsresult) 以获取结果。

## REST 调用

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

## 要求

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

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

## 另请参阅

[social\_c](/reference/live/xsapi-c/social_c/social_c_members)


## Related topics

- [XblSocialGetSocialRelationshipsResult](/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsresult.md)
- [XblSocialRelationshipFilter](/zh-CN/reference/live/xsapi-c/social_c/enums/xblsocialrelationshipfilter.md)
- [XblSocialRelationshipResultGetTotalCount](/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultgettotalcount.md)
- [XblSocialRelationshipResultGetNextAsync](/zh-CN/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultgetnextasync.md)
- [获取社交关系](/zh-CN/services/xbox-services/community/people-system/how-to/live-getting-a-social-relationship.md)
