# avatar_picks

Returns a list of a resident’s **profile picks**.

```csharp
// See "LSL Helper Functions" page for this function
smartbotsAPI("avatar_picks", [
  "avatar", "cd93067e-7c4e-41c0-ba91-be01f4bafe35"
]);
```

# Variables

The following table shows input values (you send them with the API call) and returned output values.


:::info
**Note:** This API command applies only to **Standard bots**.

:::

## Input basic parameters

| Variable | Required | Description |
|----------|----------|-------------|
| action   | yes      | = avatar_picks |
| apikey   | yes      | Your personal [developer's API key](/doc/developers-api-key-tw8bQj4LSJ) |
| botname  | yes      | Your bot’s SL login |
| secret   | yes      | [Bot access code](https://www.mysmartbots.com/docs/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 the caller script. This value will be returned in the HTTP response |

## Input

| Variable | Required | Description |
|----------|----------|-------------|
| avatar   | yes      | The UUID of the avatar whose picks to fetch |
| skipnames | optional | Skip picks whose name **contains** this substring (case-insensitive) |
| matchnames | optional | Return only picks whose name **contains** this substring (case-insensitive) |
| matchuuid | optional | Return only the pick for this **parcel UUID** |

## Output

*(To be received in* `http_response` *LSL event, see* [*docs for details*](/doc/doing-http-api-calls-c6FSEMF7bP)*)*

| Variable | Description |
|----------|-------------|
| result   | `OK`- command completed successfully<br>`FAIL` - command failed |
| resulttext | Detailed reason for the failure |
| custom   | The value from input `"custom"` parameter |
| total    | Total number of picks (not affected by filters) |
| picks    | List of the resident’s picks (possibly filtered) — a string containing parcel UUIDs and pick names separated by newlines |

### Example Output Format

```
Parcel-UUID-1 name-of-the-pick-1
Parcel-UUID-2 name-of-the-pick-2
...
```

## Working with large lists

The **LSL** `**llHTTPRequest()**` function limits response size to **2048 bytes (1024 Unicode characters)**.  
If the resident has many picks, you can filter results using these parameters:

* `skipnames` — ignore picks containing this substring
* `matchnames` — include only picks containing this substring
* `matchuuid` — return a specific pick by parcel UUID

## Examples

### Example 1 — Get all picks

```
https://www.mysmartbots.com/api/bot.html?action=avatar_picks&avatar=cd93067e-7c4e-41c0-ba91-be01f4bafe35&...
```

**Response:**

```
07300856-2d89-754e-dfb2-dd73553d76dc Earn2Life.com Discount Shop
ff1dd581-7eea-8b1f-68f5-eab19046571d Earn2Life.com: Free Lindens & Jobs!
9e1c606a-c69c-5af0-cc35-017854b8ec12 SLBiz2Life Advertising: advertise here!
```

### Example 2 — Filter by name (“earn2life”)

```
https://www.mysmartbots.com/api/bot.html?action=avatar_picks&avatar=cd93067e-7c4e-41c0-ba91-be01f4bafe35&matchnames=earn2life&...
```

**Response:**

```
07300856-2d89-754e-dfb2-dd73553d76dc Earn2Life.com Discount Shop
ff1dd581-7eea-8b1f-68f5-eab19046571d Earn2Life.com: Free Lindens & Jobs!
```