# inventory_to_prim

Put an item from inventory to in-world prim

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("inventory_to_prim", [
  "inventory", "877d11f0-72ad-649e-3ba2-96185b72d345",
  "prim", "e2252ccd-34f3-b341-ce7a-df49ccf3070a"
]);
```

# 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_to_prim |
| 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 |
|----------|----------|-------------|
| inventory | yes      | The inventory item UUID. |
| prim     | yes      | The in-world prim UUID. |

## Output

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

| 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. |

# Comments

The command locates an item in bot's inventory, then locates the in-world prim and puts the item to the prim.

The prim has to be "visible" to the bot (reside nearby the bot). The command may fail if bot has just logged in or teleported, and does not "see" surrounding objects yet. It is recommended to wait 3-5 seconds after teleporting to let surrounding objects load.

# Return values

The command returns

```
result=OK
```

if item has been put to the prim successfully.