Get message content
Returns the content the message was sent or received with. Request: GET /v1/messages/{id}/content. Scope: messages:read.
GET
Returns the content the message was sent or received with.
apiKeyheader
x-api-key<token>id*stringMatch
^msg_[0-9a-hjkmnp-tv-z]{16,24}$MessageContent
application/json- response
text?string|nullhtml?string|nullmarkdown?string|nullsms?|nullwhatsapp?|nullemail?|nullstructured?|nullmetadata?|nullimport { createClient } from "samva";
const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });
const result = await samva.messages.getContent({
"id": "example"
});Example Response
{
"text": "string",
"html": "string",
"markdown": "string",
"sms": {
"text": "string",
"unicode": true,
"parts": 0
},
"whatsapp": {
"text": "string",
"template": {
"name": "string",
"language": "string",
"components": [
{
"type": "header",
"sub_type": "url",
"index": "string",
"parameters": [
{
"type": "text",
"text": "string",
"currency": {
"fallback_value": "string",
"code": "string",
"amount_1000": 0
},
"date_time": {
"fallback_value": "string"
},
"image": {
"link": "string"
},
"document": {
"link": "string",
"filename": "string"
},
"video": {
"link": "string"
},
"coupon_code": "string",
"action": {
"flow_token": "string"
}
}
]
}
]
},
"interactive": {
"type": "buttons",
"header": {
"type": "text",
"text": "string"
},
"body": "string",
"footer": "string",
"buttons": [
{
"id": "string",
"title": "string"
}
]
},
"media": {
"type": "image",
"url": "string",
"caption": "string",
"filename": "string"
},
"reaction": {
"messageId": "string",
"providerMessageId": "string",
"emoji": "string"
},
"location": {
"latitude": 0,
"longitude": 0,
"name": "string",
"address": "string",
"url": "string"
},
"contacts": [
{
"name": {
"formattedName": "string",
"firstName": "string",
"lastName": "string",
"middleName": "string",
"prefix": "string",
"suffix": "string"
},
"phones": [
{
"phone": "string",
"type": "string",
"waId": "string"
}
],
"emails": [
{
"email": "string",
"type": "string"
}
],
"urls": [
{
"url": "string",
"type": "string"
}
],
"org": {
"company": "string",
"department": "string",
"title": "string"
},
"addresses": [
{
"street": "string",
"city": "string",
"state": "string",
"zip": "string",
"country": "string",
"countryCode": "string",
"type": "string"
}
],
"birthday": "string"
}
],
"reply": {
"type": "button",
"id": "string",
"title": "string",
"description": "string"
},
"flowResponse": {
"flowToken": "string",
"response": {
"property1": "string",
"property2": "string"
},
"body": "string"
},
"context": {
"messageId": "string",
"providerMessageId": "string"
}
},
"email": {
"subject": "string",
"html": "string",
"text": "string",
"headers": {
"property1": "string",
"property2": "string"
},
"tracking": {
"opens": true,
"clicks": true
},
"attachments": [
{
"filename": "string",
"contentId": "string",
"isInline": true,
"content": "string",
"mediaId": "string",
"contentType": "string",
"size": 0
}
]
},
"structured": {
"type": "string",
"data": {
"property1": "string",
"property2": "string"
}
},
"metadata": {
"property1": "string",
"property2": "string"
}
}