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

# PFAccountManagementServerLinkNintendoSwitchDeviceIdAsync

> Server API to link a Nintendo Switch device identifier to a specified PlayFab player account so the device can sign in on future sessions.

Links the NintendoSwitchDeviceId to the user's PlayFab account

## Syntax

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

### Parameters

**`titleEntityHandle`**   PFEntityHandle

PFEntityHandle for a title Entity obtained using PFAuthenticationGetEntityWithSecretKeyAsync.

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

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, and macOS. See also ServerUnlinkNintendoSwitchDeviceIdAsync. Call XAsyncGetStatus to get the status of the operation. If the service call is unsuccessful, the async result will be 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)
- [PFAccountManagementServerLinkNintendoSwitchDeviceIdRequest](/services/playfab/api-references/c/pfaccountmanagementtypes/structs/pfaccountmanagementserverlinknintendoswitchdeviceidrequest.md)
- [PFAccountManagementServerUnlinkNintendoSwitchDeviceIdAsync](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementserverunlinknintendoswitchdeviceidasync.md)
- [PFAccountManagementClientLinkNintendoSwitchDeviceIdAsync](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientlinknintendoswitchdeviceidasync.md)
- [PFAccountManagementClientUnlinkNintendoSwitchDeviceIdAsync](/services/playfab/api-references/c/pfaccountmanagement/functions/pfaccountmanagementclientunlinknintendoswitchdeviceidasync.md)
