From WhatsAppTemplateComponents.schema.yaml (ratatoskr/WhatsAppTemplateComponents.schema
)
---
$id: https://skeleton.botmd.io/ratatoskr/WhatsAppTemplateComponents.schema
$schema: http://json-schema.org/draft-07/schema#
title: WhatsApp Template Components
description: WhatsApp template components based on the [documentation](https://developers.facebook.com/docs/graph-api/reference/whats-app-business-account/message_templates).
type: array
minItems: 1
items:
$ref: "#/definitions/component"
definitions:
component:
title: Component
description: Individual component within a WhatsApp template.
type: object
additionalProperties: false
anyOf:
- required: [type, text]
- required: [type, format]
- required: [type, buttons]
properties:
type:
title: Type
description: Whether it is a `HEADER`, `BODY`, `FOOTER`, or `BUTTONS`.
enum: [HEADER, BODY, FOOTER, BUTTONS]
format:
title: Format
description: The content type within the component.
enum: [TEXT, IMAGE, DOCUMENT, VIDEO, LOCATION]
example:
title: Example
description: An example provided by WhatsApp.
text:
title: Text
description: For text content.
type: string
minLength: 1
buttons:
title: Buttons
description: For CTA and quick reply buttons
type: array
items:
type: object
additionalProperties: false
required: [type, text]
properties:
type:
title: Type
description: The button type.
enum: [QUICK_REPLY, URL, PHONE_NUMBER, VOICE_CALL]
text:
title: Text
description: Text to display for the button.
type: string
minLength: 1
example:
title: Example
description: An example provided by WhatsApp.
url:
title: URL
description: URL for `URL` button.
type: string
format: uri
phone_number:
title: Phone Number
description: Phone number for `PHONE_NUMBER` buttons.
type: string
pattern: '^\+[\d]{5,}$'
#end properties
#end component
#end definitions