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

# PFAccountManagementClientLinkFacebookAccountAsync

> Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account

Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account

## Syntax

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

### Parameters

**`entityHandle`**   PFEntityHandle

PFEntityHandle to use for authentication.

**`request`**   [PFAccountManagementLinkFacebookAccountRequest\*](/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementlinkfacebookaccountrequest)

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 Win32, Linux, Android, iOS, and macOS. Facebook sign-in is accomplished using the Facebook User Access Token. More information on the Token can be found in the Facebook developer documentation ([https://developers.facebook.com/docs/facebook-login/access-tokens/](https://developers.facebook.com/docs/facebook-login/access-tokens/)). In Unity, for example, the Token is available as AccessToken in the Facebook SDK ScriptableObject FB. Note that titles should never re-use the same Facebook applications between PlayFab Title IDs, as Facebook provides unique user IDs per application and doing so can result in issues with the Facebook ID for the user in their PlayFab account information. If you must re-use an application in a new PlayFab Title ID, please be sure to first unlink all accounts from Facebook, or delete all users in the first Title ID. See also ClientLoginWithFacebookAsync, ClientUnlinkFacebookAccountAsync. Call XAsyncGetStatus to get the status of the operation. If the service call is unsuccessful, the async result will be E\_PF\_ACCOUNT\_ALREADY\_LINKED, E\_PF\_ACCOUNT\_NOT\_FOUND, E\_PF\_FACEBOOK\_API\_ERROR, E\_PF\_INVALID\_FACEBOOK\_TOKEN, E\_PF\_LINKED\_ACCOUNT\_ALREADY\_CLAIMED or any of the global PlayFab Service errors. See doc page "Handling PlayFab Errors" for more details on error handling.

## Requirements

**Header:** PFAccountManagement.h

## See also

[PFAccountManagement members](/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members)


## Related topics

- [Services C API overview - PFAccountManagement.h](/services/playfab/api-references/c/pfaccountmanagement/pfaccountmanagement_members.md)
- [PFAccountManagementClientLinkFacebookInstantGamesIdAsync](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinkfacebookinstantgamesidasync.md)
- [PFAccountManagementClientUnlinkFacebookAccountAsync](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinkfacebookaccountasync.md)
- [PFAccountManagementClientUnlinkFacebookInstantGamesIdAsync](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinkfacebookinstantgamesidasync.md)
- [PFAccountManagementLinkFacebookAccountRequest](/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementlinkfacebookaccountrequest.md)
