Get message content

Returns the content the message was sent or received with. Use this endpoint to get message content through the Samva email API.

GET
/v1/messages/{id}/content

Returns the content the message was sent or received with.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^msg_[0-9a-hjkmnp-tv-z]{16,24}$

Response Body

MessageContent

application/json
  1. response
text?string|null
html?string|null
markdown?string|null
sms?|null
whatsapp?|null
email?|null
structured?|null
metadata?|null
Example Request
import { 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"  }}

Related documentation