Difference between revisions of "HTTP API/Bot Commands/texture upload"

From SmartBots Developers Docs
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE: texture_upload}} <onlyinclude>Uploads and creates a new texture in inventory</onlyinclude> <syntaxhighlight lang="lsl"> // See "LSL Helper Functions" page for...")
Line 12: Line 12:
{{API Variables Table}}
{{API Variables Table}}
{{API HTTP Required Vars|parcel_info_update}}
{{API HTTP Required Vars|texture_upload}}
{{API Variable Group|Input}}
{{API Variable Group|Input}}

Latest revision as of 16:59, 16 January 2020

Uploads and creates a new texture in inventory

// See "LSL Helper Functions" page for this function
smartbotsAPI("parcel_buy", [
  "x", 30,
  "y", 60


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 = texture_upload
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.
name yes the name of the new texture
data yes the texture data, Base64-encoded.

The image format is JPG, PNG or TIFF.

folder optional the folder UUID. If not specified, the texture will be created in "Textures" folder
loseless optional "1" - tell Second Life to use loseless compression for this texture
(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.


The command creates a new inventory texture and returns its inventory item UUID and asset UUID. The difference is that "inventory UUID" is being used to manipulate the inventory, while "asset UUID" can be used to put the texture on a prim.

It is unlikely to call this command from LSL script because of the image data.

Return values

The command returns

uuid=the new inventory item UUID
asset_uuid=the texture asset UUID

if texture has been successfully created.

<< return back to Bot commands

(Miss an API call or parameter? Submit your request in forum)