TSGGLOBAL Support sign in
Skip to page content
Browse TSG Global API docs

TSG Global API documentation Programmable MMS Send an MMS Message Using Templates Preview MMS Template

Preview MMS Template

On this page

For testing and debugging purposes, you can preview how the resulting MMS will look like without actually sending.

POST https://mmsc.tsgglobal.world/mms/templates/:id/preview

Renders a preview of the template with the given parameters without sending, where :id is the ID of the created template.

Request body

Name Type Description
data.type string Must be "mms-template-preview-req"
data.attributes.from string Required. Sender number (E.164)
data.attributes.to array of strings Required. Recipient numbers (E.164)
data.attributes.params object Required. Key-value map of placeholder values. Must match all placeholders defined in the template

Example

Example request

{
  "data": {
    "type": "mms-template-preview-req",
    "attributes": {
      "from": "18003004001",
      "to": ["17818434375"],
      "params": {
        "name": "Jane",
        "company": "TSG"
      }
    }
  }
}

Example response

{
  "data": {
    "attributes": {
      "metadata": {},
      "from": "18003004001",
      "parts": [
        {
          "metadata": {},
          "uri": null,
          "body": "Dear Jane, welcome to TSG.",
          "kind": "plain",
          "headers": {},
          "content_type": "text/plain",
          "content_location": null
        },
        {
          "metadata": {},
          "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/1-brochure.txt",
          "body": null,
          "kind": "uri",
          "headers": {},
          "content_type": null,
          "content_location": "brochure.txt"
        },
        {
          "metadata": {},
          "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/2-unnamed-1.png",
          "body": null,
          "kind": "uri",
          "headers": {},
          "content_type": null,
          "content_location": "unnamed-1.png"
        }
      ],
      "to": [
        "17818434375"
      ],
      "subject": "Hello Jane",
      "request_delivery_reports": false
    },
    "id": "f67481a0-a532-4dda-b931-6973ce292558",
    "type": "mms-forward-req"
  }
}

Example without placeholders

Example request

{
  "data": {
    "type": "mms-template-preview-req",
    "attributes": {
      "from": "18003004001",
      "to": ["17818434375"],
      "params": {}
    }
  }
}

Example response

{
  "data": {
    "attributes": {
      "metadata": {},
      "from": "18003004001",
      "parts": [
        {
          "metadata": {},
          "uri": null,
          "body": "New deals available!",
          "kind": "plain",
          "headers": {},
          "content_type": "text/plain",
          "content_location": null
        },
        {
          "metadata": {},
          "uri": "https://content-mms.staging.smshub.world/templates/491aa990-1fbb-4058-8af0-c78049010d2f/attachments/2-unnamed-1.png",
          "body": null,
          "kind": "uri",
          "headers": {},
          "content_type": null,
          "content_location": "unnamed-1.png"
        }
      ],
      "to": [
        "17818434375"
      ],
      "subject": "New deals!",
      "request_delivery_reports": false
    },
    "id": "f67481a0-a532-4dda-b931-6973ce292558",
    "type": "mms-forward-req"
  }
}