InventoryService

=Introduction=

The OpenSimulator inventory service stores user inventory data (object items, notecard items, folders, etc.) and provides this on request. Note that every inventory item points towards an immutable asset entry that actually contains the data.

The current default ROBUST OpenSimulator inventory service is known as the XInventoryService.

TODO: Document remaining operations: CREATEUSERINVENTORY (unused), GETUSERINVENTORY (unused), GETINVENTORYSKELETON, GETROOTFOLDER, UPDATEFOLDER, MOVEFOLDER, DELETEFOLDERS, PURGEFOLDER, UPDATEITEM, MOVEITEMS, GETACTIVEGESTURES, GETASSETPERMISSIONS.

=API=

General notes
Unlike the asset service, the xinventory service is an RPC interface. Therefore it exposes only one URI which is xinventory (e.g. http://localhost:8003/xinventory). The invocation of different operations (e.g. add item, get item) is controlled via a METHOD parameter.

Formats
The API calls below return folder and item data in the same format. These formats are detailed below.

Item
This has the form

where


 * AssetID is the UUID of the asset for this inventory item (e.g. the actual serialized object data for a primitive).
 * AssetType is the asset type of this item. See the AssetType enum in libopenmetaverse for more details.  In this case the asset type is 6 to denote an object.
 * BasePermissions the base permissions for the item. See the Permissions flags enum in libopenmetaverse for more details.
 * CreationDate is the unix time stamp of the creation date of the item.
 * CreatorId is the UUID of the creator.
 * CreatorData is extended creator data information for the item (as used by the --creators option in the "save iar" command). This may be blank.
 * CurrentPermissions are the permissions that the current owner has over the item when rezzed. See the Permissions flags enum in libopenmetaverse for more details.
 * Description is the description of the item. This may be blank.
 * EveryOnePermissions are the permissions that anyone would have over the item when rezzed. See the Permissions flags enum in libopenmetaverse for more details.
 * Flags is an integer flags entry. For a bodypart or clothing (both wearables), the type of wearable is signalled by an enumeration.  See the WearableType enum in libopenmetaverse for more details.  In this case, the value is zero since we're dealing with an object rather than a wearable.  Other possible uses of Flags need documentation.
 * Folder is the UUID of the folder containing this item.
 * GroupID is the UUID of the group that owns this item, if any. If there is no owner then this is UUID.Zero (00000000-0000-0000-0000-000000000000).
 * GroupOwner is true if the item is group owned, false if not.
 * GroupPermissions are the group permissions for the item, if applicable. See the Permissions flags enum in libopenmetaverse for more details.
 * ID is the UUID of the item.
 * InvType is the inventory type of the item. See the InventoryType enum in libopenmetaverse for more details.  In this case the inventory type is 6 to denote an object.
 * Name is the name of the item.
 * NextPermissions are the permissions that the next owner of this item will receive.
 * Owner is the UUID of the owner of this item
 * SalePrice is the sale price of this item.
 * SaleType is the sale type of this item. See the SaleType enum in libopenmetaverse for more details.

In some cases where multiple items can be returned the item element will have an underscore and index value appended (e.g. item_0 instead of folder). This is for historical reasons.

Folder
This has the form

where


 * ParentID is the parent folder ID. For the root ("My Inventory") folder this is always UUID.Zero (00000000-0000-0000-0000-000000000000).
 * Type is the type of the folder. See the InventoryType enum in libopenmetaverse for more details.  In this case, the type is 9 (RootCategory) since this is a root folder.
 * Version is the version of the folder. This is used for viewer inventory caching purposes.
 * Name is the name of the folder.
 * Owner is the UUID of the avatar that owns the folder.
 * ID is the unique id of the folder itself.

In some cases where multiple folders can be returned the folder element will have an underscore and index value appended (e.g. folder_0 instead of folder). This is for historical reasons.

GETROOTFOLDER
This returns data about a user's root folder (i.e. their "My Inventory" folder). POST field is a urlencoded string like so

PRINCIPAL=efc1b932-20e3-4298-8824-0f891fe3dc59&METHOD=GETROOTFOLDER

where


 * METHOD is GETROOTFOLDER
 * PRINCIPAL is the UUID of the user

If successful, example return is

If the request fails (e.g. because the PRINCIPAL does not exist) you will receive an empty response

See for more details about the folder format.

GETFOLDERFORTYPE
This returns data about the user's system folder for a particular type (e.g. their "Clothing" system folder). POST field is a urlencoded string like so

PRINCIPAL=efc1b932-20e3-4298-8824-0f891fe3dc59&TYPE=13&METHOD=GETFOLDERFORTYPE

where


 * METHOD is GETFOLDERFORTYPE
 * PRINCIPAL is the UUID of the user
 * TYPE is the type of system folder to get.  See the AssetType enum in libopenmetaverse for more details. In this case the asset type is 13 for the body parts sytem folder.

If successful, example return is

If the request fails (e.g. because the PRINCIPAL does not exist or a system folder of the given type does not exist) you will receive an empty response with an HTTP OK status code.

See for more details about the folder format.

GETFOLDER
This returns data about a particular inventory folder. POST field is a urlencoded string like so

ID=efc1b932-20e3-4298-8824-0f891fe3dc59&METHOD=GETFOLDER

where


 * METHOD is GETFOLDER
 * ID is the folder UUID

If successful, example return is

If the request fails (e.g. because the PRINCIPAL does not exist) you will receive an empty response

See for more details about the folder format.

GETFOLDERCONTENT
This returns the children folders and items of a given inventory folder. POST field is a urlencoded string like so

PRINCIPAL=efc1b931-20e3-4298-8824-0f891fe3dc59&FOLDER=efc1b932-20e3-4298-8824-0f891fe3dc59&METHOD=GETFOLDERCONTENT

where


 * METHOD is GETFOLDERCONTENT
 * PRINCIPAL is the user that owns the folder. This is currently mandatory but is really only present for historical reasons.
 * FOLDER is the folder UUID

If successful, example return is

If the request fails (e.g. because the PRINCIPAL does not exist) you will receive an empty response

See for more details about the folder format. Note that the folder elements here have an index parameter appended ( rather than ). This piece of insanity is for historical reasons.

See for more details about the item format. Note that the item elements here have an index parameter appended ( rather than ). This piece of insanity is for historical reasons.

GETFOLDERITEMS
This returns the items of a given inventory folder. POST field is a urlencoded string like so

PRINCIPAL=efc1b931-20e3-4298-8824-0f891fe3dc59&FOLDER=efc1b932-20e3-4298-8824-0f891fe3dc59&METHOD=GETFOLDERITEMS

where


 * METHOD is GETFOLDERCONTENT
 * PRINCIPAL is the user that owns the folder. This is currently mandatory but is really only present for historical reasons.
 * FOLDER is the folder UUID

If successful, example return is

If the request fails (e.g. because the PRINCIPAL does not exist) you will receive an empty response

See for more details about the item format. Note that the item elements here have an index parameter appended ( rather than ). This piece of insanity is for historical reasons.

GETITEM
This returns data about a particular inventory item. POST field is a urlencoded string like so

ID=2b410a2f-e639-4d09-a4d4-e6ca71bc68bd&METHOD=GETITEM

where


 * METHOD is GETITEM
 * ID is the item UUID

If successful, example return is

If the request fails then you will see a blank service response

ADDFOLDER
This adds an folder to a user's inventory. POST field is a urlencoded string like so

Name=Current+Outfit&ID=F5BF95EB-DE03-808D-E98E-DDDBC8F3CB2E&ParentID=0592938c-ee24-45a5-af04-55e0f30838f7&Owner=efc1b932-20e3-4298-8824-0f891fe3dc59&Type=46&Version=1&METHOD=ADDFOLDER

The format of the elements of these params is the same as in. The folder version should always be 1. This example actually adds a "Current Outfit" type folder - normally the type would be 8 (for an ordinary folder).

If successful, return is

If unsuccessful then

ADDITEM
This adds an inventoryitem to a given inventory folder. POST field is a urlencoded string like so

AssetID=4bb6fa4d-1cd2-498a-a84c-95c1a0e745a7&AssetType=13&Name=my+eyes+2&Owner=efc1b932-20e3-4298-8824-0f891fe3dc59&ID=7C8A732C-9634-3800-AB97-DD2EF4C1B367&InvType=18&CreatorId=efc1b932-20e3-4298-8824-0f891fe3dc59&CreatorData=&Description=generic+eyes+desc&BasePermissions=581639&CurrentPermissions=581632&NextPermissions=581639&EveryOnePermissions=0&GroupID=00000000-0000-0000-0000-000000000000&GroupOwned=False&GroupPermissions=0&SalePrice=0&SaleType=0&Flags=3&CreationDate=1347571855&Folder=40506578-704d-49bb-adbc-98b2c4719fb2&METHOD=ADDITEM

The format of the elements of these params is the same as in

If successful, return is

If unsuccessful then

DELETEITEMS
These deletes inventory items for a given user. POST field is a urlencoded string like so

METHOD=DELETEITEMS&PRINCIPAL=efc1b932-20e3-4298-8824-0f891fe3dc59&ITEMS[]=1d09e24c-2b2a-8072-602a-950c9a3a8d18&ITEMS[]=3a057d48-adc7-de32-060f-0aac62fc6da9

where


 * METHOD is the API method, in this case DELETEITEMS
 * PRINCIPAL is the user UUID.
 * ITEMS[] are the UUIDs of the items to delete. There can be one or many of these.

Response is currently always

even if the given principal or item IDs are not found or are not well-formed UUIDs.

will only be returned if the PRINCPIAL parameter or any ITEMS[] parameters were not present.