# cards.sunshine.getDraft

> Published by [sunshine.cards](https://lexicon.garden/identity/did:web:sunshine.cards)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:web:sunshine.cards/cards.sunshine.getDraft)
- [Documentation](https://lexicon.garden/lexicon/did:web:sunshine.cards/cards.sunshine.getDraft/docs)
- [Examples](https://lexicon.garden/lexicon/did:web:sunshine.cards/cards.sunshine.getDraft/examples)

## Definitions

### `cards.sunshine.getDraft#card`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `back` | `string` (uri) | No | A short-lived URL of the card's back artwork. |
| `card` | `unknown` | No | The card's cards.sunshine.card record. Present only when the viewer may see it. |
| `front` | `string` (uri) | No | A short-lived URL of the card's front artwork. |
| `index` | `integer` | Yes | The card's position in the draft. |

### `cards.sunshine.getDraft`

**Type**: `query`

Shows a draft set to someone asked to review it. Called through the viewer's PDS (service auth). The viewer sees the cards meant for them; the rest are just their positions. A draft the viewer may see none of answers DraftNotFound, as a missing one does.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `card` | `integer` | No | Ask for just the card at this position. |
| `uri` | `string` (at-uri) | Yes | The cards.sunshine.draft record, in its creator's deck. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cards` | `array` | Yes | The draft's cards, in order. Asked for one card, just that one. |
| `createdAt` | `string` (datetime) | Yes |  |
| `explainer` | `string` | No | The draft's note to reviewers, in Markdown (CommonMark). |
| `set` | `unknown` | Yes | The draft's cards.sunshine.set record. |

#### Errors

- **DraftNotFound**: There's no such draft, or the viewer may see none of it.
- **CreatorUnavailable**: The creator's deck can't be reached right now.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "card": {
      "properties": {
        "back": {
          "description": "A short-lived URL of the card's back artwork.",
          "format": "uri",
          "type": "string"
        },
        "card": {
          "description": "The card's cards.sunshine.card record. Present only when the viewer may see it.",
          "type": "unknown"
        },
        "front": {
          "description": "A short-lived URL of the card's front artwork.",
          "format": "uri",
          "type": "string"
        },
        "index": {
          "description": "The card's position in the draft.",
          "maximum": 499,
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "index"
      ],
      "type": "object"
    },
    "main": {
      "description": "Shows a draft set to someone asked to review it. Called through the viewer's PDS (service auth). The viewer sees the cards meant for them; the rest are just their positions. A draft the viewer may see none of answers DraftNotFound, as a missing one does.",
      "errors": [
        {
          "description": "There's no such draft, or the viewer may see none of it.",
          "name": "DraftNotFound"
        },
        {
          "description": "The creator's deck can't be reached right now.",
          "name": "CreatorUnavailable"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cards": {
              "description": "The draft's cards, in order. Asked for one card, just that one.",
              "items": {
                "ref": "#card",
                "type": "ref"
              },
              "maxLength": 500,
              "type": "array"
            },
            "createdAt": {
              "format": "datetime",
              "type": "string"
            },
            "explainer": {
              "description": "The draft's note to reviewers, in Markdown (CommonMark).",
              "maxGraphemes": 10000,
              "maxLength": 100000,
              "type": "string"
            },
            "set": {
              "description": "The draft's cards.sunshine.set record.",
              "type": "unknown"
            }
          },
          "required": [
            "set",
            "cards",
            "createdAt"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "card": {
            "description": "Ask for just the card at this position.",
            "maximum": 499,
            "minimum": 0,
            "type": "integer"
          },
          "uri": {
            "description": "The cards.sunshine.draft record, in its creator's deck.",
            "format": "at-uri",
            "type": "string"
          }
        },
        "required": [
          "uri"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "cards.sunshine.getDraft",
  "lexicon": 1
}
```
