{"id":11970,"date":"2019-10-22T15:58:05","date_gmt":"2019-10-22T06:58:05","guid":{"rendered":"https:\/\/www.eformsign.com\/kr\/support\/?post_type=manual_documentation&#038;p=11970"},"modified":"2019-11-27T10:44:35","modified_gmt":"2019-11-27T01:44:35","slug":"download-document","status":"publish","type":"manual_documentation","link":"https:\/\/www.eformsign.com\/en\/support\/documentation\/open-api\/download-document\/","title":{"rendered":"2.3.6 OPA_006 Download document(Document PDF, audit trail PDF)"},"content":{"rendered":"\n<p>API which downloads the document<\/p>\n\n\n\n<h2>Rest API<\/h2>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>domain\/v1.0\/api\/documents\/{DOCUMENT_ID}\/download_files<\/td><\/tr><\/tbody><\/table>\n\n\n\n<ul><li><em>Must use Access Token issued company.api_url for its domain<\/em><\/li><\/ul>\n\n\n\n<p>Example<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td>https:\/\/sg-api.eformsign.com\/v1.0\/api\/documents\/d803930e2094464aab548c340f7c8a4b\/download_files<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h2>Method<\/h2>\n\n\n\n<p>&#8211; GET<\/p>\n\n\n\n<h3>Request Header<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Miscellaneous<\/strong><\/td><td><strong>Required<\/strong><\/td><\/tr><tr><td>access_token<\/td><td>String<\/td><td>Access token<\/td><td>&nbsp;<\/td><td>O<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h3>QueryString<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td> <strong>Miscellaneous <\/strong><\/td><td><strong>Required<\/strong><\/td><\/tr><tr><td>file_type<\/td><td>String<\/td><td>Type of the file which to download<\/td><td>document, audit_trail (Can use both by using , separator)<\/td><td>O<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h3>Request Body<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Miscellaneous<\/strong><\/td><\/tr><\/tbody><\/table>\n\n\n\n<h3>Response Header<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Miscellaneous<\/strong><\/td><\/tr><tr><td>Content-Type<\/td><td>String<\/td><td>Content-Type<\/td><td>application\/json<\/td><\/tr><tr><td>Content-disposition<\/td><td>String<\/td><td>Content-disposition<\/td><td>\uc608\uc2dc attachment; filename=\uc724\uc2b9\ud658 \ud734\uac00 \uc2e0\uccad\uc11c.pdf;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h3>Response Body<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Miscellaneous<\/strong><\/td><\/tr><\/tbody><\/table>\n\n\n\n<h3>Fail Response Body<\/h3>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><strong>Name<\/strong><\/td><td><strong>Type<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Miscellaneous<\/strong><\/td><\/tr><tr><td>error<\/td><td>Object<\/td><td>Error details<\/td><td>Only appears when there is an error. Error object (includes code, message)<\/td><\/tr><tr><td>error.code<\/td><td>String<\/td><td>Error code<\/td><td>&nbsp;<\/td><\/tr><tr><td>error.message<\/td><td>String<\/td><td>Error message<\/td><td>&nbsp;<\/td><\/tr><\/tbody><\/table>\n\n\n\n<h4>Example<\/h4>\n\n\n\n<p><strong>Request<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GET \/v1.0\/api\/documents\/d803930e2094464aab548c340f7c8a4b\/status HTTP\/1.1\n\nContent-Type : application\/json\n\naccess_token : eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJvY2UuaWFtIiwiY29udGV4dCI6eyJjbGllbnRJ....\n\nHOST : https:\/\/sg-api.eformsign.com<\/code><\/pre>\n\n\n\n<p><strong>Response<\/strong><\/p>\n\n\n\n<p>&#8211; When succeeded<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HTTPS\/1.1 200 OK\nContent-Type: application\/pdf\nContent-disposition : attachment; filename=John Doe approval.pdf;<\/code><\/pre>\n\n\n\n<p>&#8211; When failed (error)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HTTPS \/ 1.1 403 forbidden\nContent-Type: application\/json\n{\n\"error\": {\n\"code\": \"4030001\",\n\"message\": \"invalid api key\"\n}\n}<\/code><\/pre>\n","protected":false},"author":1,"featured_media":0,"parent":11930,"menu_order":0,"template":"","manualdocumentationcategory":[44],"_links":{"self":[{"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation\/11970"}],"collection":[{"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation"}],"about":[{"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/types\/manual_documentation"}],"author":[{"embeddable":true,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation\/11970\/revisions"}],"predecessor-version":[{"id":12734,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation\/11970\/revisions\/12734"}],"up":[{"embeddable":true,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation\/11930"}],"wp:attachment":[{"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/media?parent=11970"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manualdocumentationcategory?post=11970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}