{"id":11974,"date":"2019-10-22T16:03:25","date_gmt":"2019-10-22T07:03:25","guid":{"rendered":"https:\/\/www.eformsign.com\/kr\/support\/?post_type=manual_documentation&#038;p=11974"},"modified":"2020-09-15T10:59:29","modified_gmt":"2020-09-15T01:59:29","slug":"doc-creation","status":"publish","type":"manual_documentation","link":"https:\/\/www.eformsign.com\/en\/support\/documentation\/open-api\/doc-creation\/","title":{"rendered":"2.3.7 OPA_007 Document creation"},"content":{"rendered":"\n<p>API for creating documents using an API key.<\/p>\n\n\n\n<h2>Rest API<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>domain\/v1.0\/api\/forms\/{FORM_ID}\/documents<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<ul><li><em>The domain must use the company.api_url value in which the access token is issued.<\/em><\/li><\/ul>\n\n\n\n<p>Example<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>https:\/\/kr-api.eformsign.com\/v1.0\/api\/forms\/61b05d369b2a4a10b5c4c8a1373abc0d\/documents<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2>Method<\/h2>\n\n\n\n<p>&#8211; POST<\/p>\n\n\n\n<h3>Request Header<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Name<\/td><td>Type<\/td><td>Description<\/td><td>Remark<\/td><td>Required?<\/td><\/tr><tr><td>Content-Type<\/td><td>String<\/td><td>Content-Type<\/td><td>application\/json<\/td><td>O<\/td><\/tr><tr><td>access_token<\/td><td>String<\/td><td>Access token<\/td><td>Member access token<\/td><td>O<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3>QueryString<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Name<\/td><td>Type<\/td><td>Description<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3>Request Body<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Name<\/td><td>Type<\/td><td>Description<\/td><td>Remark<\/td><td>Required?<\/td><\/tr><tr><td>title<\/td><td>String<\/td><td>Document title<\/td><td>The title set in the template is set if there is no value.&nbsp;<\/td><td>X<\/td><\/tr><tr><td>next_steps<\/td><td>Array<\/td><td>Next step list<\/td><td>Includes step objects (step_type, comment, approvers)<br><br>The document is saved as a draft is there is no value.<\/td><td>X<\/td><\/tr><tr><td>next_steps[].step_type<\/td><td>String<\/td><td>Next step type<\/td><td>approval, outsider, accept, complete<\/td><td>X<\/td><\/tr><tr><td>next_steps[].comment<\/td><td>String<\/td><td>Next step request comment<\/td><td>&nbsp;<\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers<\/td><td>Array<\/td><td>Requester list (included in approval, internal recipient, and external recipient steps)<\/td><td>Includes approver object (user_id)<\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].user_id<\/td><td>String<\/td><td>ID of the next step requester<br>(&#8220;All&#8221; if its&#8217; an internal request and requesting to all internal recipients)<\/td><td>&nbsp;<\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].user_name<\/td><td>String<\/td><td>The requester name, for external recipient requests<\/td><td><\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].code<\/td><td>String<\/td><td>The country code for SMS requests, for external recipient requests<\/td><td>E.g. \u201c+82\u201d<\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].number<\/td><td>String<\/td><td>The mobile phone number for SMS requests, for external recipient requests<\/td><td><\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].auth_password<\/td><td>String<\/td><td>The verification password, for external recipient requests<\/td><td><\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].auth_valid_time    <\/td><td>number<\/td><td>The validity time for external recipient review, for  external recipient requests<\/td><td><\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].auth_hint<\/td><td>String<\/td><td>The verification password hint,  for  external recipient requests<\/td><td><\/td><td>X<\/td><\/tr><tr><td>next_steps[].approvers[].type<\/td><td>String<\/td><td>The requester type, for internal recipient requests<\/td><td>member, group<\/td><td>X<\/td><\/tr><tr><td>form_fields<\/td><td>Array<\/td><td>List of data to be written in components in documents<\/td><td>Includes form_field objects (input_form_id, input_form_value)<\/td><td>X<\/td><\/tr><tr><td>form_fields[].input_form_id<\/td><td>String<\/td><td>Form ID in components in documents<\/td><td>&nbsp;<\/td><td>X<\/td><\/tr><tr><td>form_fields[].input_form_value<\/td><td>String<\/td><td>Data to be written in components in documents<\/td><td>&nbsp;<\/td><td>X<\/td><\/tr><tr><td>group<\/td><td>String<\/td><td>Group name<\/td><td>The group information is set in the default value of the input field in template field settings.<br>Required when the document creator belongs to 2 or more groups.<br>Ignore when the document creator belongs to 1 group or no groups.<\/td><td>X<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3>Response Header<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Name<\/td><td>Type<\/td><td>Description<\/td><td>Remark<\/td><\/tr><tr><td>Content-Type<\/td><td>String<\/td><td>Content-Type<\/td><td>application\/json<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3>Success Response Body<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Name<\/td><td>Type<\/td><td>Description<\/td><td>Remark<\/td><\/tr><tr><td> document_title <\/td><td> String <\/td><td>Document title <\/td><td>The title of a created document<\/td><\/tr><tr><td> document_id <\/td><td> String <\/td><td>Document ID<\/td><td>The unique ID of a created document<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3>Fail Response Body<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td>Name<\/td><td>Type<\/td><td>Description<\/td><td>Remark<\/td><\/tr><tr><td>error<\/td><td>Object<\/td><td>Error details<\/td><td>-Displayed only in errors<br>-Includes error objects (includes code and messages)<\/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><\/figure>\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>POST \/v1.0\/api\/forms\/61b05d369b2a4a10b5c4c8a1373abc0d\/documents HTTP\/1.1\n\nContent-Type : application\/json\n\naccess_token : eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJvY2UuaWFtIiwiY29udGV4dCI6eyJjbGllbnRJ....\n\nHOST : https:\/\/kr-api.eformsign.com\n\n{\n\n\"form_version\" : \"1\",\n\"title\" : \"Holiday request\",\n\"next_steps\" : [ \/\/ saved as draft if next_step doesn't exist.\n{\n\"step_type\" : \"approval\",\n\"comment\" : \"\",\n\"approvers\" : [\n{\n\"user_id\" : \"test1@forcs.com\"\n}\n]\n}\n],\n\"form_fields\" : [\n{\n\"input_form_id\" : \"TextBox1\",\n\"input_form_value\" : \"This is a test 1\"\n},\n{\n\"input_form_id\" : \"TextBox2\",\n\"input_form_value\" : \"This is a test 2\"\n}\n]\n}<\/code><\/pre>\n\n\n\n<p><strong>Response<\/strong><\/p>\n\n\n\n<p>&#8211; Success<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>HTTPS\/1.1 200 OK\nContent-Type: application\/json\n{\n\"document_title\": \"openAPItest\",\n\"document_id\": \"e433c854ca034a88bd2e1a0e380afe9b\"\n}<\/code><\/pre>\n\n\n\n<p>&#8211; Failure<\/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\/11974"}],"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":11,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation\/11974\/revisions"}],"predecessor-version":[{"id":14530,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manual_documentation\/11974\/revisions\/14530"}],"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=11974"}],"wp:term":[{"taxonomy":"manualdocumentationcategory","embeddable":true,"href":"https:\/\/www.eformsign.com\/en\/support\/wp-json\/wp\/v2\/manualdocumentationcategory?post=11974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}