Documentazione

La documentazione per sviluppatori è in inglese.

Tipo di scheda

snippet

A joke, fun fact, quote, affirmation or life hack.

Version 1 · schema snippet.v1.schema.json

Layouts

Every card type has full. Pick a layout with the element's layout attribute, render.layout, or a theme.

Fields

The fields of card.data. Values a source doesn't provide are null; new optional fields can appear within version 1.

FieldTypeRequiredNotes
kindenumyesjoke · fun_fact · quote · affirmation · life_hack
textstringyes
punchlinestring | nullyesJokes only: shown after the set-up.
attributionnull | objectyes
attribution.namestringyes
attribution.detailstring | nullyes

Example

A recorded answer to “Tell me a joke”. Open it in the Answer Lab to see every layout and style.

Response
{
  "v": 2,
  "id": "ans_0g6a4c3h0ntghfnm",
  "matched": true,
  "locale": "en",
  "skill": "joke",
  "confidence": 0.9,
  "text": "How can you tell the difference between a monster and a banana? Try picking it up. If you can’t, it’s either a monster or a giant banana.",
  "speech": "How can you tell the difference between a monster and a banana? … Try picking it up. If you can’t, it’s either a monster or a giant banana.",
  "card": {
    "type": "snippet",
    "version": 1,
    "data": {
      "kind": "joke",
      "text": "How can you tell the difference between a monster and a banana?",
      "punchline": "Try picking it up. If you can’t, it’s either a monster or a giant banana.",
      "attribution": null
    }
  },
  "sources": [
    {
      "name": "WebKnox joke collection",
      "url": null,
      "license": null
    }
  ],
  "follow_ups": [],
  "actions": [],
  "usage": {
    "billable": true
  }
}