# inventory_list_2

Returns a list of the bot’s inventory folder contents.

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("inventory_list_2", [
  "uuid", ""
]);
```

# Variables

The following table shows input values (you send them with the API call) and returned output values.

## Input basic parameters

| Variable | Required | Description |
|----------|----------|-------------|
| action   | yes      | = inventory_list_2 |
| apikey   | yes      | Your personal [developer's API key](/doc/developers-api-key-tw8bQj4LSJ) |
| botname  | yes      | Your bot's SL login |
| secret   | yes      | [Bot access code](https://www.mysmartbots.com/docs/Bot_access_code) of your bot |
| custom   | optional | The custom data (string) to be passed back to caller script. This value will be returned back to the caller in HTTP response |

## Input

| Variable | Required | Description |
|----------|----------|-------------|
| dataType | required | Must be set to `'json'`. |
| uuid     | optional | The UUID of the folder. Leave blank to list the root folder. |
| skipnames | optional | Skip attachments whose names contain this substring (case-insensitive) |
| matchnames | optional | Return only attachments whose names contain this substring (case-insensitive) |
| matchuuid | optional | Return only attachment with this UUID |

## Output (JSON)

*(To be received in* `*http_response*` *LSL event, see* [*docs for details*](/doc/doing-http-api-calls-c6FSEMF7bP)*)*

| Variable | Description |
|----------|-------------|
| result   | OK - command completed successfully<br>FAIL - command failed |
| resulttext | Detailed reason for the failure |
| custom   | The value from input "custom" parameter. See above |
| list     | The contents of the selected folder (see below) |

# Return value

An example return value of the bot’s inventory is below.

```javascript
{
  "action": "inventory_list_2",
  "result": "OK",
  "list": [
    {
      "uuid": "12b4eca0-5499-3321-ac14-56e5ecb25e95",
      "name": "Instructions Notecard",
      "flags": "",
      "assetUuid": "719197e1-79bb-a8f8-4901-ccee019982b6",
      "currentPerms": [
        "copy",
        "mod",
        "trans"
      ],
      "type": "Notecard",
      "nextPerms": [
        "copy",
        "mod",
        "trans"
      ],
      "clothing": ""
    },
    //...more items
  ]
}
```

# Inventory-ID vs Asset-ID

There is an important distinction between **Inventory ID** and **Asset ID**:

* **Inventory ID** — the object’s ID in the bot’s personal inventory.
* **Asset ID** — the global ID of the item in Second Life’s asset server.

You may have two identical textures in the bot’s inventory:  
They will have **different Inventory-IDs** but the **same Asset-ID** because they reference the same image on the SL server.

**Rules:**

* When rezzing an item from inventory, use the **Inventory ID** (you rez a specific object).
* When setting a texture via script, use the **Asset ID** (the script tells SL to fetch that texture globally).

# Flags

`WORN` — the item is currently being worn by the bot. Only clothing items, textures, and body parts are supported (not attachments).