Preview Article

POST https://api.presshub.io/v1/preview

Returns previewable article documents for each service specified in the request.

Body JSON
template
array
required
Presshub template array. See Get Template Info endpoint for the template structure. See Presshub Template structure information.
services
array
required
Array of service names to generate previewable data.
Body JSON Format
{
  "template": {
    "version": "1.0",
    "title": "Your Article Title",
    "subtitle": "Your Article Subtitle",
    "canonicalURL": "http://example.com/your-article-url.html",
    "keywords": [
      "Keyword1",
      "Keyword2",
      "Keyword3"
    ],
    "maturityRating": null,
    "language": "en",
    "thumbnail": "https://example.com/article-thumbnail.jpg",
    "template": "basic",
    "components": [
      {
        "map": "byline",
        "value": "By Author Name",
        "options": []
      },
      {
        "map": "featured_image",
        "value": "URL",
        "options": {
          "Caption": "Image caption",
          "Photographer": "Photo by Name"
        }
      },
      {
        "map": "body",
        "value": "<p>HTML content</p>",
        "options": []
      }
    ]
  },
  "services": {
    "AppleNews" : [],
    "Medium" : [],
    "Twitter" : {
      "message": ""
    },
    "Slack" : {
      "message": ""
    },
    "FacebookIA" : {
      "message": ""
    },
    "LinkedIn" : {
      "message": ""
    }
  }
}
Response Format
{
  "data": {
    "AppleNews": "{\"version\":\"1.3\",\"identifier\":\"document-fba4d7f8f1e66c52043991ade9f07244\",\"title\":\"Your Article Title\",\"language\":\"en\",\"layout\":{\"columns\":13,\"width\":1024,\"margin\":60,\"gutter\":20},\"components\":[{\"components\":[{\"text\":\"Your Article Title\",\"format\":\"markdown\",\"textStyle\":\"title-style\",\"role\":\"title\",\"layout\":\"title-layout\"},{\"text\":\"Your Article Subtitle\",\"format\":\"markdown\",\"textStyle\":\"subtitle-style\",\"role\":\"intro\",\"identifier\":\"component-5812e48f8a5b1\",\"layout\":\"subtitle-layout\"},{\"components\":[{\"text\":\"By Author Name\",\"textStyle\":\"byline-style\",\"role\":\"byline\",\"identifier\":\"component-5812e48f8a73b\"},{\"text\":\"Oct 27, 2016\",\"textStyle\":\"byline-style\",\"role\":\"body\",\"identifier\":\"component-5812e48f8a82b\"}],\"role\":\"container\",\"identifier\":\"component-5812e48f8a69f\",\"layout\":\"byline-layout\"}],\"role\":\"header\",\"identifier\":\"component-5812e48f88fbe\"},{\"text\":\"HTML content\n\n\",\"format\":\"markdown\",\"textStyle\":\"body-style\",\"role\":\"body\",\"identifier\":\"component-5812e48f8ca47\",\"layout\":{\"columnStart\":1,\"columnSpan\":11,\"margin\":{\"top\":12,\"bottom\":50}}}],\"componentTextStyles\":{\"default\":{},\"title-style\":{\"textAlignment\":\"left\",\"lineHeight\":52,\"paragraphSpacingBefore\":18,\"paragraphSpacingAfter\":18,\"fontName\":\"Avenir-Black\",\"fontSize\":48,\"textColor\":\"#2E2E2E\",\"textTransform\":\"none\"},\"subtitle-style\":{\"textAlignment\":\"left\",\"lineHeight\":26,\"paragraphSpacingBefore\":18,\"paragraphSpacingAfter\":18,\"fontName\":\"Avenir-Medium\",\"fontSize\":20,\"textColor\":\"#2E2E2E\",\"textTransform\":\"none\"},\"byline-style\":{\"textAlignment\":\"left\",\"lineHeight\":20,\"paragraphSpacingBefore\":18,\"paragraphSpacingAfter\":18,\"fontName\":\"Avenir-Medium\",\"fontSize\":14,\"textColor\":\"#B2B2B2\",\"textTransform\":\"none\"},\"body-style\":{\"textAlignment\":\"left\",\"lineHeight\":25,\"linkStyle\":{\"textColor\":\"#0CC3FF\"},\"paragraphSpacingBefore\":18,\"paragraphSpacingAfter\":18,\"fontName\":\"HoeflerText-Regular\",\"fontSize\":19,\"textColor\":\"#2E2E2E\"}},\"subtitle\":\"Your Article Subtitle\",\"metadata\":{\"datePublished\":\"2016-10-27T22:39:27-07:00\",\"generatorName\":\"PresshubIO\",\"canonicalURL\":\"http://example.com/your-article-ul.html\",\"thumbnailURL\":\"https://example.com/article-thumbnail.jpg\",\"keywords\":[[\"Keyword1\",\"Keyword2\",\"Keyword3\"]],\"excerpt\":\"Your Article Subtitle\"},\"componentLayouts\":{\"title-layout\":{\"columnStart\":0,\"columnSpan\":13,\"margin\":{\"top\":30,\"bottom\":5}},\"subtitle-layout\":{\"columnStart\":0,\"columnSpan\":13,\"margin\":{\"bottom\":25}},\"byline-layout\":{\"columnStart\":0,\"columnSpan\":13,\"margin\":{\"top\":0,\"bottom\":25}},\"body-layout\":{\"columnStart\":1,\"columnSpan\":11,\"margin\":{\"top\":15,\"bottom\":0}}},\"submission_metadata\":{\"isSponsored\":false,\"isPreview\":false,\"isCandidateToBeFeatured\":false,\"isDevelopingStory\":false,\"maturityRating\":null}}",
    "Medium": "<h1>Your Article Title</h1><h2>Your Article Subtitle</h2><p>HTML content</p>",
    "Twitter": "Your Article Title http://example.com/your-article-ul.html",
    "LinkedIn": "Your Article Title http://example.com/your-article-ul.html"
  }
}