{"id":1043,"date":"2017-02-17T04:17:02","date_gmt":"2017-02-17T10:17:02","guid":{"rendered":"https:\/\/www.teamdesk.net\/blog\/?p=1043"},"modified":"2020-04-07T05:16:07","modified_gmt":"2020-04-07T10:16:07","slug":"word-pdf-document-generation-via-rest-api","status":"publish","type":"post","link":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/","title":{"rendered":"Word\/PDF document generation via REST API"},"content":{"rendered":"<p>We&#8217;ve extended <a href=\"https:\/\/teamdesk.crmdesk.com\/answer.aspx?aid=21930\">REST API<\/a> with an ability to generate Word\/PDF documents.<\/p>\n<p><!--more--><\/p>\n<h2>Document Method<\/h2>\n<p>This method allows you to&nbsp;generate Word\/PDF document for selected records from a table given either their ids. The order the records matches the order ids are passed in.<\/p>\n<h3>Parameters<\/h3>\n<ul>\n<li><strong>table<\/strong>: the singular name of the table or its alias as returned by the Describe (Application) method. Please note that this parameter is embedded into the URL before the method name.<\/li>\n<li><strong>document<\/strong>: the name of the document or its alias as returned by the Describe (Table). Please note that this parameter is embedded into the URL before the method name. \uf0b7<\/li>\n<li><strong>id<\/strong>: the value of internal record id. Can appear multiple times. You cannot render the document for more than 500 records at once.<\/li>\n<\/ul>\n<h3>Request<\/h3>\n<pre>GET https:\/\/www.teamdesk.net\/secure\/api\/v2\/{appid}\/{table}\/{document}\/document?params<\/pre>\n<p>Render document for Id and Text column from records with id 156 and 157<\/p>\n<pre>GET https:\/\/www.teamdesk.net\/secure\/api\/v2\/21995\/Test\/SampleDoc\/document?id=156&amp;id=157<\/pre>\n<h3>Response<\/h3>\n<p>Generated document file. Output format (DOCX or PDF) matches document settings defined in the database.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;ve extended REST API with an ability to generate Word\/PDF documents.<\/p>\n","protected":false},"author":5,"featured_media":1048,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1043","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-whats-new"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Word\/PDF document generation via REST API - TeamDesk Blog<\/title>\n<meta name=\"description\" content=\"We&#039;ve extended REST API with document method to allow you automate Word\/PDF document generation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Word\/PDF document generation via REST API - TeamDesk Blog\" \/>\n<meta property=\"og:description\" content=\"We&#039;ve extended REST API with document method to allow you automate Word\/PDF document generation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/\" \/>\n<meta property=\"og:site_name\" content=\"TeamDesk Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-17T10:17:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-07T10:16:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2017\/02\/pdf-word-document-generation-rest-api.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"727\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Slava Shynderov\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Slava Shynderov\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/\"},\"author\":{\"name\":\"Slava Shynderov\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/478c18541e8c72f93caf641086d96b07\"},\"headline\":\"Word\\\/PDF document generation via REST API\",\"datePublished\":\"2017-02-17T10:17:02+00:00\",\"dateModified\":\"2020-04-07T10:16:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/\"},\"wordCount\":164,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/pdf-word-document-generation-rest-api.jpg\",\"articleSection\":[\"What's New\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/\",\"name\":\"Word\\\/PDF document generation via REST API - TeamDesk Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/pdf-word-document-generation-rest-api.jpg\",\"datePublished\":\"2017-02-17T10:17:02+00:00\",\"dateModified\":\"2020-04-07T10:16:07+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/478c18541e8c72f93caf641086d96b07\"},\"description\":\"We've extended REST API with document method to allow you automate Word\\\/PDF document generation.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/pdf-word-document-generation-rest-api.jpg\",\"contentUrl\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/pdf-word-document-generation-rest-api.jpg\",\"width\":1200,\"height\":727},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/whats-new\\\/word-pdf-document-generation-via-rest-api\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Word\\\/PDF document generation via REST API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/\",\"name\":\"TeamDesk Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/#\\\/schema\\\/person\\\/478c18541e8c72f93caf641086d96b07\",\"name\":\"Slava Shynderov\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ebd9835685868383868fa4e09d807b517765b7ed0c8f3d6153be12931545ef0f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ebd9835685868383868fa4e09d807b517765b7ed0c8f3d6153be12931545ef0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ebd9835685868383868fa4e09d807b517765b7ed0c8f3d6153be12931545ef0f?s=96&d=mm&r=g\",\"caption\":\"Slava Shynderov\"},\"url\":\"https:\\\/\\\/www.teamdesk.net\\\/blog\\\/author\\\/slava-shynderov\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Word\/PDF document generation via REST API - TeamDesk Blog","description":"We've extended REST API with document method to allow you automate Word\/PDF document generation.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/","og_locale":"en_US","og_type":"article","og_title":"Word\/PDF document generation via REST API - TeamDesk Blog","og_description":"We've extended REST API with document method to allow you automate Word\/PDF document generation.","og_url":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/","og_site_name":"TeamDesk Blog","article_published_time":"2017-02-17T10:17:02+00:00","article_modified_time":"2020-04-07T10:16:07+00:00","og_image":[{"width":1200,"height":727,"url":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2017\/02\/pdf-word-document-generation-rest-api.jpg","type":"image\/jpeg"}],"author":"Slava Shynderov","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Slava Shynderov","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#article","isPartOf":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/"},"author":{"name":"Slava Shynderov","@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/478c18541e8c72f93caf641086d96b07"},"headline":"Word\/PDF document generation via REST API","datePublished":"2017-02-17T10:17:02+00:00","dateModified":"2020-04-07T10:16:07+00:00","mainEntityOfPage":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/"},"wordCount":164,"commentCount":0,"image":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2017\/02\/pdf-word-document-generation-rest-api.jpg","articleSection":["What's New"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/","url":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/","name":"Word\/PDF document generation via REST API - TeamDesk Blog","isPartOf":{"@id":"https:\/\/www.teamdesk.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#primaryimage"},"image":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#primaryimage"},"thumbnailUrl":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2017\/02\/pdf-word-document-generation-rest-api.jpg","datePublished":"2017-02-17T10:17:02+00:00","dateModified":"2020-04-07T10:16:07+00:00","author":{"@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/478c18541e8c72f93caf641086d96b07"},"description":"We've extended REST API with document method to allow you automate Word\/PDF document generation.","breadcrumb":{"@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#primaryimage","url":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2017\/02\/pdf-word-document-generation-rest-api.jpg","contentUrl":"https:\/\/www.teamdesk.net\/blog\/wp-content\/uploads\/2017\/02\/pdf-word-document-generation-rest-api.jpg","width":1200,"height":727},{"@type":"BreadcrumbList","@id":"https:\/\/www.teamdesk.net\/blog\/whats-new\/word-pdf-document-generation-via-rest-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.teamdesk.net\/blog\/"},{"@type":"ListItem","position":2,"name":"Word\/PDF document generation via REST API"}]},{"@type":"WebSite","@id":"https:\/\/www.teamdesk.net\/blog\/#website","url":"https:\/\/www.teamdesk.net\/blog\/","name":"TeamDesk Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.teamdesk.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.teamdesk.net\/blog\/#\/schema\/person\/478c18541e8c72f93caf641086d96b07","name":"Slava Shynderov","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ebd9835685868383868fa4e09d807b517765b7ed0c8f3d6153be12931545ef0f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ebd9835685868383868fa4e09d807b517765b7ed0c8f3d6153be12931545ef0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ebd9835685868383868fa4e09d807b517765b7ed0c8f3d6153be12931545ef0f?s=96&d=mm&r=g","caption":"Slava Shynderov"},"url":"https:\/\/www.teamdesk.net\/blog\/author\/slava-shynderov\/"}]}},"_links":{"self":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/1043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/comments?post=1043"}],"version-history":[{"count":6,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/1043\/revisions"}],"predecessor-version":[{"id":2129,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/posts\/1043\/revisions\/2129"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/media\/1048"}],"wp:attachment":[{"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/media?parent=1043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/categories?post=1043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.teamdesk.net\/blog\/wp-json\/wp\/v2\/tags?post=1043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}