Difference between revisions of "HTTP API/Bot Commands/inventory list"
m (Phil moved page HTTP API: Bot Commands/listinventory to HTTP API/Bot Commands2/listinventory) |
|
(No difference)
|
Revision as of 13:00, 29 June 2016
Returns a list ofthe bot's inventory folder contents.
Contents
Variables
The following table shows input values (you send them with the API call) and returned output values.
Variable | Required | Description | ||
---|---|---|---|---|
Input basic parameters: | ||||
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: | ||||
uuid | The optional UUID of the folder. Leave blank to list the root folder. | |||
extended | Set this to 1 to get an extended output. This output includes:
See examples below. | |||
Output: | ||||
(to be received in http_response LSL event, see docs for details) | ||||
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
listinventory returns the contents of folders in the bots 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
The parts are joined using ";" (excluding Inventory item name which ends with the line end). See the examples below for more info.
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 ";". See the examples below for more info.
Errors
Due to technical reasons the empty folder returned when non-existing UUID is being used. Contact SmartBots support if this is critical for your app.
Inventory-ID vs Asset-ID
There's a huge difference between "inventory ID" and "asset ID":
- "Inventory ID" is an id of the object in avatar's personal inventory.
- "Asset ID" is a global id of the item within SL database ("asset server").
Therefore, you may have two identical textures in the bots inventory: they will have a different Inventory-ID but the same Asset-ID (because they point to the same image on the SL server).
So, the rules are:
- When you rez an item from inventory, you need to pick up an object by Inventory-ID. You rez specific object.
- When the script sets a texture to a face, it uses Asset-ID (because scripts have no access to your inventory! It just tells SL to fetch a specific image from the global database)
Flags
The only supported flag is WORN - it means that this item is being worn by the bot.
Limitations: currently only clothing items, textures and body parts are supported. Attached objects are not displayed.
Examples
The root folder of the inventory usually looks like this:
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 101991fc-3d51-01e2-7e73-63f16be921f;Folder;;;;#Firestorm 27bd140c-909d-4276-a49e-bf9944ee651;Folder;;;;Sounds 2c75a0fe-2fcd-45be-8419-8361842a847;Folder;;;;Body Parts 43883597-3934-48db-96fe-bb34f1e8766;Folder;;;;Notecards 43eaa34e-093a-7d14-fe96-bd64d78de50;Folder;;;;#Phoenix 5bd0a873-002a-a7c3-74cf-c1cc5be211c;Folder;;;;#Emerald 5f10f3bf-4fa1-0a18-6f52-6d9548a75aa;Folder;;;;[AA] Model AO 1 - BOX 5ffd9b89-6d76-463f-956a-0fcb64f4928;Folder;;;;Objects 6b048138-9f33-8eb1-3ac2-5c4886e3c70;Folder;;;;Trash 77d2ad71-9de5-417a-93e4-0ba6fe4a7bc;Folder;;;;Gestures 8b50a0b4-1052-9c3c-28e6-3c155b60d8c;Folder;;;;* Deviance * - Elementalist - Seashore 8c2bb070-89cb-4ce0-a02c-873de2064b9;Folder;;;;Lost And Found 92316b8d-f833-498b-831e-b4f5932d9b0;Folder;;;;Textures 9fbc1880-1200-8b9a-06aa-4d5c058e5c6;Folder;;;;AtomicDoll - Demo All Male Skins a389076b-3a33-4afd-86c0-5464b8ffb84;Folder;;;;Animations a4da6fea-4a3e-4964-b8d2-13c82a19a78;Folder;;;;Landmarks a98fb9c8-f249-0812-c2e8-95a8a4559ff;Folder;;;;SEmotion Brilliantly Pack - 10 animations b311bf78-71bc-47e1-95e8-45d0c39c81f;Folder;;;;Clothing c26f7b9a-c7e8-4e38-8d58-7c16d422351;Folder;;;;Calling Cards d278df15-f312-fa32-3470-3faf0aef8f1;Folder;;;;Fashion f046dc7d-bf10-f42e-3564-b9d4fc481d8;Folder;;;;Favorites f31a1241-660b-d335-beb6-76ddf483d17;Folder;;;;Current Outfit f90e4ed3-6e1a-417b-9561-078fe680022;Folder;;;;Scripts
The contents of the inventory folder can look like this:
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 117b1220-28bd-b7a4-0046-6f32f241929;Object;;00000000-0000-0000-0000-000000000000;;*X*plosions Eye Lashes 2390ee90-de46-81ca-bf1f-633840e05be;Object;;00000000-0000-0000-0000-000000000000;;*X* (small) LadyCatShoes BLACKenemy LOWERLEFT 475f32cb-805e-28a3-bc93-5ffdffe71bf;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion SoldierBLACK ForearmRIGHT 4796a6c4-e2e0-1590-c52f-b175c06b261;Clothing;Jacket;279b6fa7-9314-d34e-9932-aa7c59c5483;WORN;*X*plosion Freak Suspender white 49aa8bdc-f2e7-39f7-8587-fff8e8895ac;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion SoldierBLACK HandRIGHT 5fbb474d-a819-8a39-a86a-10a8d63dfa9;Clothing;Pants;05684417-2b36-c547-a046-ddd092a5267;WORN;*X*plosion CrazyPantie Break (white) 6e6c3477-f1fe-2dfc-8c93-cee01845381;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion Body Light ~M~ 86b3f91d-58b8-0aec-0ea3-990a5cb7c76;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion SoldierBLACK ForearmLEFT 8a2f212a-7766-cfb6-e831-02abc4643dd;Bodypart;Shape;05b9c5d4-a769-4ef1-870b-6fb92f90022;WORN;*X*plosion Shape Kaiko 8d4fd212-d295-64e2-c145-14eca1b61af;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion KillerCatScarf BlackSMALL(female) 95377bab-2f33-0059-d65e-69c0a089de0;Clothing;Shirt;5a43d2fa-5a3d-8b09-d643-173ed773e80;WORN;*Xplosion KillerCat ShirtBlack (female) 9da35db5-8616-a1e7-7100-6aae6183d2b;Bodypart;Hair;6d6c888d-5318-8fb6-f17d-16acb73f27fd;WORN;Xplosion hairbase a87ac339-95e1-fb70-672b-2e9b0d5a7f6;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion FightMask BlackSMALL(female) d5c7d384-ccac-fd02-c8ee-ae6c51da53d;Clothing;Gloves;11ac6add-576f-562f-ec31-4c7ae15c369;WORN;*X*plosion BLACK SoldierGloves de0e1e02-d5e4-fb44-520d-e5046f4ebd3;Bodypart;Eyes;8e4c7fdd-2534-89be-2166-d0b3f2618f4;WORN;New Generation Eyes Blue (big) df70ca04-d078-8ec5-4f69-1afc5a05dd4;Clothing;Shoes;0873df9e-29b4-e2d2-2fe2-5aceb7bd0ee;WORN;*X*plosion SHOE BLACK e6ee5e8b-3373-88b8-da40-e8d3300a8a7;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion SoldierBLACK HandLEFT
Extended output
Extended output (with &extended=1 http parameter) includes url-escaped object name and object permissions:
e6ee5e8b-3373-88b8-da40-e8d3300a8a7;Object;;00000000-0000-0000-0000-000000000000;;*X*plosion%20SoldierBLACK%20HandLEFT;copy+mod+trans;copy
<< return back to Bot commands
(Miss an API call or parameter? Submit your request in forum)