### Summary:
This article details how to use an external user ID from a platform like Facebook, Google, or Apple - to find the existing Unity player account they have.
This can be important if a player reaches out to you for support but they don't know their Unity ID, only the ID the external provider has for them. The solution involves using the Player Authentication Admin API to retrieve the Unity Player ID by filtering based on the external ID.
Developers might need this article if a player issues a GDPR deletion request from outside of the game, which is the specific scenario that prompted this article.
### Title:
Finding Unity Cloud Player ID Using External ID.
### Symptoms:
- You require a player's Unity ID to facilitate a support request for them.
- You only have the ID from the external login provider they use to log in to your game.
### Cause:
The issue often arises when players lack the ability to reach out from inside the game; an in-game support mechanism would allow them to send requests with their Unity Player ID automatically attached.
### Resolution:
1. Use a service account and the Player Authentication Admin API to list matching players and filter based on the user's external ID. For example, if the ID they provide is from Facebook:
```
https://services.api.unity.com/player-identity/v1/projects/{{projectId}}/users?limit=10&idProvider=facebook.com&externalId={FacebookID}
```
2. Once the Unity Player ID is identified, delete the player's data from:
- **Leaderboards:** Use the endpoint to delete player scores.
```
https://services.docs.unity.com/leaderboards-admin/#tag/Leaderboards/operation/deleteLeaderboardPlayerScoreAllLiveLeaderboards
```
- **Cloud Save:** Delete Player Items, Public Player Items, Protected Player Items, and Private Player Items.
```
https://services.docs.unity.com/cloud-save/#tag/Data
```
- **Analytics:** Find relevant Analytics User ID (which is different from the Unity Player ID) using SQL Data Explorer, and submit a deletion event.
```
https://docs.unity.com/ugs/en-us/manual/analytics/manual/request-data-deletion-rest-api
```
3. Implement an in-app data deletion request feature to automate this process using Cloud Code and the Analytics SDK's RequestDataDeletion() method.