# Create Player Feedback

In this How-to, we'll go through how to report a Player.

## Prerequisites

* [An active Game Session](https://docs.lootlocker.com/players/authentication)
* [At least 1 configured Player Feedback Category](https://docs.lootlocker.com/game-systems/feedback/how-to/manage-categories)

## Retrieve Category IDs

Before we can create the Feedback report, we first need to find the category to report the player under.

If you only have a single category, you could manually retrieve the category ID from the [LootLocker Console](https://console.lootlocker.com/feedback/settings/player). However, if you have multiple categories, you should list the categories and let the player choose which category to report under.

{% hint style="info" %}
When working with Category IDs manually in your code, be aware that switching between environments (e.g. development, staging, production) requires you to modify which ID is used in your game code. This is not the case when using the endpoint to list the categories.
{% endhint %}

To retrieve all the categories, we can use the following code:

{% tabs %}
{% tab title="Unity" %}

```csharp
public void RetrieveCategoryIDs()
{
    LootLockerSDKManager.ListPlayerFeedbackCategories((response) =>
    {
        if (!response.success)
        {
            // Replace this with your own error handling
            Debug.Log("Could not list player related feedback categories");
            Debug.Log(response.errorData.ToString());
            return;
        }

        // Replace this section with your own UI to let the player choose the category
        foreach (var category in response.categories)
        {
            Debug.Log(category.name + "\n"
                + category.description + "\n"
                + category.id);
        }
    });
}
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-4651305f63b873bf81260e807b91a151aa3860b2%2Fue-bp-list-player-feedback-categories.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/h1xst1-w/">Blueprint example of listing feedback categories for players</a></p></figcaption></figure>
{% endtab %}

{% tab title="REST" %}

```bash
curl -X "https://api.lootlocker.io/game/feedback/category/entity/player" \
    -H "x-session-token: your_token_here"
```

{% endtab %}
{% endtabs %}

## Send Player Report

Now that we have the category ID, we can send the player report.

To send a player report, we need to provide the following information:

* The category ID
* The ULID of the player being reported
* Optionally a description, which can be entered by the player, or filled in by the game

{% hint style="info" %}
How to get the ULID for the player being reported will vary from game to game, but it's currently returned in the player session endpoints, leaderboard endpoints and lookup endpoints.
{% endhint %}

{% tabs %}
{% tab title="Unity" %}

```csharp
public void SendPlayerReport()
{
    string cateogryID = "category_id_here";
    string reportedPlayerULID = "player_id_here";
    string description = "The Player had an inappropiate profile picture";

    LootLockerSDKManager.SendPlayerFeedback(reportedPlayerULID, description, cateogryID, (response) =>
    {
        if (!response.success)
        {
            // Replace this with your own error handling
            Debug.Log("Could not report player");
            Debug.Log(response.errorData.ToString());
            return;
        }

        // Replace this with your own success handling
        Debug.Log("Report sent to LootLocker");
    });
}
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-51fcf20d95235aa8171c2563628fe924f1a3d3fb%2Fue-bp-send-player-report-feedback.png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/stm5l3ki/">Blueprint example of reporting players</a></p></figcaption></figure>
{% endtab %}

{% tab title="REST" %}

```bash
curl -X "https://api.lootlocker.io/game/feedback" \
    -H "x-session-token: your_token_here" \
    -D '{
    "entity": "player",
    "entity_id": "",
    "category_id": "category_id_here",
    "description": "The Player had an inappropiate profile picture"
    }'
```

{% endtab %}
{% endtabs %}

## Conclusion

In this How-to, we've gone through how to list categories and report a player. If you want to learn more you can read our [Create Game Feedback](https://docs.lootlocker.com/game-systems/feedback/how-to/create-game-feedback) or [Create UGC Feedback](https://docs.lootlocker.com/game-systems/feedback/how-to/create-ugc-feedback) How-to's.
