inventory_list

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

This command also works in a legacy form: listinventory

// See "LSL Helper Functions" page for this function
smartbotsAPI("inventory_list", [
  "uuid", "",
  "extended", 1
]);

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

= listinventory

apikey

yes

Your personal developer's API key

botname

yes

Your bot's SL login

secret

yes

Bot access code of your bot

dataType

optional

Set to "json" to get JSON reply instead of URL-encoded string

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

uuid

optional

The UUID of the folder. Leave blank to list the root folder.

extended

optional

Set to 1to get extended output. This includes:

* URL-encoded object names
* Current owner’s permissions column added
* Next owner’s permissions column added

Output

(To be received in *http_response* LSL event, see docs for details)

Variable

Description

result

OK - command completed successfully
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 format below)

Return value

The listinventory command returns the contents of folders in the bot’s inventory.

Regular output (no extended=1)

The following data is returned:

  • Inventory UUID (the main ID of the inventory item)

  • Item type (object, notecard, clothing, etc.)

  • Clothing type (if applicable)

  • Asset UUID (when available)

  • Flags

  • Inventory item name

Parts are joined using ; (excluding the Inventory item name, which ends with a line break).

Extended output (with extended=1)

The following data is returned:

  • Inventory UUID (the main ID of the inventory item)

  • Item type (object, notecard, clothing, etc.)

  • Clothing type (if applicable)

  • Asset UUID (when available)

  • Flags

  • Inventory item name (URL-escaped)

  • Current owner’s permissions (mod, copy, trans joined by +)

  • Next owner’s permissions (mod, copy, trans joined by +)

All parts are joined using ;.

Errors

Due to technical limitations, an empty folder is returned if a non-existent UUID is used.
Contact SmartBots support if this behavior is critical for your application.

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

The only supported flag is WORN — it means the item is currently being worn by the bot.

Limitations:
Currently, only clothing items, textures, and body parts are supported. Attached objects are not displayed.

Examples

Root folder of the inventory

01aa7902-bddd-aa8d-56f7-53684274a1b;Folder;;;;*X*plosion Complete Avatar ~Kaiko~
0c76eeb1-b43e-44bd-a1d7-a2ed5681fac;Folder;;;;Photo Album
10154f27-44a8-c4ed-6301-e53d1ec72c8;Folder;;;;Fashion1
...

Folder contents example

02c1968d-02bd-3bfa-7621-98c3d782005;Object;;00000000-0000-0000-0000-000000000000;;*X* (small) LadyCatShoes BLACKenemy LOWERRIGT
0486c633-7260-e65b-2cea-451e8a6e71f;Bodypart;Skin;707922bc-e7dc-a488-9a5b-da2f60051e2;WORN;*X*plosion NG SkinA Lipps5 ES5
4796a6c4-e2e0-1590-c52f-b175c06b261;Clothing;Jacket;279b6fa7-9314-d34e-9932-aa7c59c5483;WORN;*X*plosion Freak Suspender white
...

Extended output example

Extended output (with &extended=1 HTTP parameter) includes URL-escaped object names and permission columns:

e6ee5e8b-3373-88b8-da40-e8d3300a8a7;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion%20SoldierBLACK%20HandLEFT;copy+mod+trans;copy