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

# PFFriendsServerAddFriendAsync

> Agrega el usuario Friend a la lista de amigos del usuario con PlayFabId. Se debe inicializar al menos uno de FriendPlayFabId, FriendUsername, FriendEmail o FriendTitleDisplayName.

Agrega el usuario Friend a la lista de amigos del usuario con PlayFabId. Se debe inicializar al menos uno de FriendPlayFabId, FriendUsername, FriendEmail o FriendTitleDisplayName.

## Sintaxis

```cpp theme={null}
HRESULT PFFriendsServerAddFriendAsync(  
    PFEntityHandle titleEntityHandle,  
    const PFFriendsServerAddFriendRequest* request,  
    XAsyncBlock* async  
)  
```

### Parámetros

**`titleEntityHandle`**   PFEntityHandle

PFEntityHandle para una entidad de título obtenida mediante PFAuthenticationGetEntityWithSecretKeyAsync.

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

Objeto de solicitud rellenado.

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

XAsyncBlock para la operación asincrónica.

### Valor devuelto

Tipo: HRESULT

Código de resultado de esta operación de API.

## Comentarios

Esta API está disponible en Win32, Linux y macOS. Vea también ServerGetFriendsListAsync, ServerRemoveFriendAsync, ServerSetFriendTagsAsync. Llame a XAsyncGetStatus para obtener el estado de la operación. Si la llamada al servicio no se realiza correctamente, el resultado asincrónico será E\_PF\_USERS\_ALREADY\_FRIENDS o cualquiera de los errores globales de PlayFab Service. Consulte la página de documentación "Handling PlayFab Errors" para obtener más detalles sobre el control de errores.

## Requisitos

**Encabezado:** PFFriends.h

## Consulte también

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


## Related topics

- [Información general de la API de C de Services - PFFriends.h](/es/services/playfab/api-references/c/pffriends/pffriends_members.md)
- [PFFriendsServerRemoveFriendAsync](/es/services/playfab/api-references/c/pffriends/functions/pffriendsserverremovefriendasync.md)
- [PFFriendsServerGetFriendsListAsync](/es/services/playfab/api-references/c/pffriends/functions/pffriendsservergetfriendslistasync.md)
- [PFFriendsServerAddFriendRequest](/es/services/playfab/api-references/c/pffriendstypes/structs/pffriendsserveraddfriendrequest.md)
- [PFFriendsServerSetFriendTagsAsync](/es/services/playfab/api-references/c/pffriends/functions/pffriendsserversetfriendtagsasync.md)
