messagebird · Schema
MessageContent
The content of the message. The structure depends on the message type.
Properties
| Name | Type | Description |
|---|---|---|
| text | string | The text content of the message, used when type is text. |
| image | object | The image content, used when type is image. |
| video | object | The video content, used when type is video. |
| audio | object | The audio content, used when type is audio. |
| file | object | The file content, used when type is file. |
| location | object | The location content, used when type is location. |
| hsm | object | The HSM (Highly Structured Message) template content, used for WhatsApp template messages. |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "#/components/schemas/MessageContent",
"title": "MessageContent",
"type": "object",
"description": "The content of the message. The structure depends on the message type.",
"properties": {
"text": {
"type": "string",
"description": "The text content of the message, used when type is text."
},
"image": {
"type": "object",
"description": "The image content, used when type is image.",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The URL of the image."
},
"caption": {
"type": "string",
"description": "An optional caption for the image."
}
}
},
"video": {
"type": "object",
"description": "The video content, used when type is video.",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The URL of the video."
},
"caption": {
"type": "string",
"description": "An optional caption for the video."
}
}
},
"audio": {
"type": "object",
"description": "The audio content, used when type is audio.",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The URL of the audio file."
}
}
},
"file": {
"type": "object",
"description": "The file content, used when type is file.",
"properties": {
"url": {
"type": "string",
"format": "uri",
"description": "The URL of the file."
},
"caption": {
"type": "string",
"description": "An optional caption for the file."
}
}
},
"location": {
"type": "object",
"description": "The location content, used when type is location.",
"properties": {
"latitude": {
"type": "number",
"format": "double",
"description": "The latitude coordinate."
},
"longitude": {
"type": "number",
"format": "double",
"description": "The longitude coordinate."
}
}
},
"hsm": {
"type": "object",
"description": "The HSM (Highly Structured Message) template content, used for WhatsApp template messages.",
"properties": {
"namespace": {
"type": "string",
"description": "The namespace of the template."
},
"templateName": {
"type": "string",
"description": "The name of the template."
},
"language": {
"type": "object",
"properties": {
"policy": {
"type": "string",
"description": "The language policy."
},
"code": {
"type": "string",
"description": "The language code."
}
}
},
"params": {
"type": "array",
"description": "The template parameters.",
"items": {
"type": "object",
"properties": {
"default": {
"type": "string",
"description": "The default value for the parameter."
}
}
}
}
}
}
}
}