# Create UGC Feedback

In this How-to, we'll go through how to report User Generated Content (UGC).

## Prerequisites

* [An active Game Session](/players/authentication.md)
* [At least 1 configured UGC Feedback Category](/game-systems/feedback/how-to/manage-categories.md)

## Retrieve Category IDs

Before we can create the Feedback report, we first need to find the category to report the content 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/ugc). 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:

## Find Category ID for UGC Reports

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

```csharp
public void RetrieveCategoryIDs()
{
    LootLockerSDKManager.ListUGCFeedbackCategories((response) =>
    {
        if (!response.success)
        {
            // Replace this with your own error handling
            Debug.Log("Could not list UGC 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="/files/ezm7jSwtboup5ERGbB2D" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/r9slg4x0/">Blueprint example of listing feedback categories for UGC</a></p></figcaption></figure>
{% endtab %}

{% tab title="REST" %}

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

{% endtab %}
{% endtabs %}

### Send UGC Report

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

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

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

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

```csharp
public void SendUGCReport()
{
    string categoryID = "category_id_here";
    string reportDescription = "This asset is incomplete";
    string ugcUlid = "asset_ulid_here";

    LootLockerSDKManager.SendUGCFeedback(ugcUlid, reportDescription, categoryID, (response) =>
    {
        if (!response.success)
        {
            // Replace this with your own error handling
            Debug.Log("Could not report UGC");
            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="/files/MxIepoRHJ2ep3pyV8wnU" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/5v6id3zn/">Blueprint example of reporting game bugs</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": "ugc",
    "entity_id": "asset_ulid_here",
    "category_id": "category_id_here",
    "description": "This asset is incomplete"
    }'
```

{% endtab %}
{% endtabs %}

## Conclusion

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lootlocker.com/game-systems/feedback/how-to/create-ugc-feedback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
