{"_id":"5536e535bbb4a70d00a53529","project":"55357364e02d480d0003c6d3","__v":14,"category":{"_id":"553591cd63cc650d00312927","pages":["553591ce63cc650d00312928","553594c963cc650d00312931","5535985e63cc650d00312936","55365baa86514f0d00bc2f96","5536daf0a519b10d001f7df8","5536db65c16ee70d007568a8","5536dc26c16ee70d007568ac","5536de1453b6430d0042dfeb","5536e535bbb4a70d00a53529","553ab2a336d0100d004b35b1","554172c94841af0d00b4234f"],"version":"553591cd63cc650d00312925","__v":11,"project":"55357364e02d480d0003c6d3","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-20T23:52:42.707Z","from_sync":false,"order":1,"slug":"formz","title":"Formz"},"editedParams2":true,"editedParams":true,"user":"55356ede6040a20d00454508","version":{"_id":"553591cd63cc650d00312925","project":"55357364e02d480d0003c6d3","__v":13,"forked_from":"55357365e02d480d0003c6d6","createdAt":"2015-04-20T23:54:53.134Z","releaseDate":"2015-04-20T23:54:53.134Z","categories":["553591cd63cc650d00312926","553591cd63cc650d00312927","5536e4d39f7f2d0d00b1cd54","5536e55c20d5ca0d0001580a","5536e6bf7fe60f0d000fd1c0","5536f5bba171250d00c00556","553a974369c2630d00a8562e","553a97c60074c80d00621c2a","553a98332af5f20d000fc32a","553a9b9869c2630d00a85642","556e0f23d02e0b190042f13d","563249b1dcc27a1700823650","5639113f049e420d00476b03","59a5dd94aaa11d003334edb4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-22T00:03:01.666Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"POST https://api.goformz.com/v2/formz/a0fd89b2-75a7-46b3-9924-78bf51bd8804/exports","language":"http"},{"code":"{\n  \"type\": \"pdf\",\n  \"pages\": \"1-3,5\"\n}","language":"json"}]},"method":"post","results":{"codes":[]},"settings":"","auth":"required","params":[{"_id":"5536e535bbb4a70d00a5352a","ref":"","in":"path","required":true,"desc":"Id of the form to export","default":"","type":"string","name":"formId"},{"_id":"55b7fb1b31bccb190081c165","ref":"","in":"body","required":true,"desc":"Export Submission Object","default":"","type":"object","name":"body"}],"url":"/formz/:formId/exports"},"isReference":false,"order":6,"body":"The GoFormz API supports exporting formz to PDF.  Generating a PDF is a processing intensive operation and could be a long running operation.  In order to improve performance, this process consists of multiple steps.\n\n- Exporting a form to PDF\n- Create the PDF.\n- Get the metadata for the PDF.\n- Download the PDF from the Url provided in the metadata.\n\nTo export the form into a pdf, submit a POST to the formz exports endpoint:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST https://api.goformz.com/v2/formz/{formId}/exports\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nThe body of the POST request has two properties:\n- `type` - Allows you to specify the type of format to export the form to. \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"NOTE\",\n  \"body\": \"Currently `pdf` is the only supported type\"\n}\n[/block]\n- `pages` - Specify the form pages to include in the exported format.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"NOTE\",\n  \"body\": \"The pages property is optional.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"type\\\": \\\"pdf\\\",      \\n  \\\"pages\\\": \\\"1-5,7,9\\\" \\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAt this point the pdf is queued for processing.  The response headers will contain a location header that contains a link to an entry in the queue that can be polled for the status of the PDF creation.  \n\nOnce the PDF has been created, the queue entry will provide a link to the actual PDF resource.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Location: \\\"https://api.goformz.com/v2/queue/b047fa76-2ceb-4151-9c57-f93971e5d84d\\\"\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Get the metadata for the PDF\"\n}\n[/block]\nSee <a href=\"http://developers.goformz.com/docs/get-metadata-for-an-exported-pdf\" alt=\"Get exported PDF metadata\">Get exported PDF metadata</a> for more information.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Download the PDF from the Url provided in the metadata\"\n}\n[/block]\nIssue a GET request to the URL supplied in the `redirectUrl` property of the metadata to download the PDF.\n\nSample Request\nGET https://<Dynamically Generated URL>\n\n</br><a href=\"https://api.goformz.com/docs/api/explorer/index#!/Exports/Exports_Post\" target=\"_blank\"><img src=\"https://files.readme.io/9Z82WIZnS7mZmco8oi4u_TryItNow3.png\" style=\"margin-left:15px\" width=\"128\" height=\"42\" ></a>","excerpt":"","slug":"export-a-form-to-pdf","type":"endpoint","title":"Export a Form to PDF"}

postExport a Form to PDF


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

formId:
required
string
Id of the form to export

Body Params

body:
required
object
Export Submission Object

Examples


Documentation

The GoFormz API supports exporting formz to PDF. Generating a PDF is a processing intensive operation and could be a long running operation. In order to improve performance, this process consists of multiple steps. - Exporting a form to PDF - Create the PDF. - Get the metadata for the PDF. - Download the PDF from the Url provided in the metadata. To export the form into a pdf, submit a POST to the formz exports endpoint: [block:code] { "codes": [ { "code": "POST https://api.goformz.com/v2/formz/{formId}/exports", "language": "http" } ] } [/block] The body of the POST request has two properties: - `type` - Allows you to specify the type of format to export the form to. [block:callout] { "type": "info", "title": "NOTE", "body": "Currently `pdf` is the only supported type" } [/block] - `pages` - Specify the form pages to include in the exported format. [block:callout] { "type": "info", "title": "NOTE", "body": "The pages property is optional." } [/block] [block:code] { "codes": [ { "code": "{\n \"type\": \"pdf\", \n \"pages\": \"1-5,7,9\" \n}", "language": "json" } ] } [/block] At this point the pdf is queued for processing. The response headers will contain a location header that contains a link to an entry in the queue that can be polled for the status of the PDF creation. Once the PDF has been created, the queue entry will provide a link to the actual PDF resource. [block:code] { "codes": [ { "code": "Location: \"https://api.goformz.com/v2/queue/b047fa76-2ceb-4151-9c57-f93971e5d84d\"", "language": "http" } ] } [/block] [block:api-header] { "type": "basic", "title": "Get the metadata for the PDF" } [/block] See <a href="http://developers.goformz.com/docs/get-metadata-for-an-exported-pdf" alt="Get exported PDF metadata">Get exported PDF metadata</a> for more information. [block:api-header] { "type": "basic", "title": "Download the PDF from the Url provided in the metadata" } [/block] Issue a GET request to the URL supplied in the `redirectUrl` property of the metadata to download the PDF. Sample Request GET https://<Dynamically Generated URL> </br><a href="https://api.goformz.com/docs/api/explorer/index#!/Exports/Exports_Post" target="_blank"><img src="https://files.readme.io/9Z82WIZnS7mZmco8oi4u_TryItNow3.png" style="margin-left:15px" width="128" height="42" ></a>