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

# PFFriendsClientAddFriendAsync

> Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of.

Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized.

## Syntax

```cpp theme={null}
HRESULT PFFriendsClientAddFriendAsync(  
    PFEntityHandle entityHandle,  
    const PFFriendsClientAddFriendRequest* request,  
    XAsyncBlock* async  
)  
```

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFFriendsClientAddFriendRequest\*](/services/playfab/api-references/c/pffriendstypes/structs/pffriendsclientaddfriendrequest)

Populated request object.

**`async`**   XAsyncBlock\*<br />*Inout*

XAsyncBlock for the async operation.

### Return value

Type: HRESULT

Result code for this API operation.

## Remarks

This API is available on all platforms. See also ClientGetFriendsListAsync, ClientSetFriendTagsAsync. When the asynchronous task is complete, call [PFFriendsClientAddFriendGetResult](/services/playfab/api-references/c/pffriends/functions/pffriendsclientaddfriendgetresult) to get the result.

## Requirements

**Header:** PFFriends.h

## See also

[PFFriends members](/services/playfab/api-references/c/pffriends/pffriends_members)


## Related topics

- [PFFriendsClientAddFriendGetResult](/services/playfab/api-references/c/pffriends/functions/pffriendsclientaddfriendgetresult.md)
- [Services C API overview - PFFriends.h](/services/playfab/api-references/c/pffriends/pffriends_members.md)
- [PFFriendsClientRemoveFriendAsync](/services/playfab/api-references/c/pffriends/functions/pffriendsclientremovefriendasync.md)
- [PFFriendsClientGetFriendsListAsync](/services/playfab/api-references/c/pffriends/functions/pffriendsclientgetfriendslistasync.md)
- [PFFriendsClientSetFriendTagsAsync](/services/playfab/api-references/c/pffriends/functions/pffriendsclientsetfriendtagsasync.md)
