{"id":37586,"date":"2019-11-06T11:36:00","date_gmt":"2019-11-06T10:36:00","guid":{"rendered":"https:\/\/www.viafirma.com\/faqs\/policy-configuration-for-api-integrations\/"},"modified":"2024-05-02T14:49:38","modified_gmt":"2024-05-02T12:49:38","slug":"policy-configuration-for-api-integrations","status":"publish","type":"faq","link":"https:\/\/www.viafirma.com\/en\/faqs\/policy-configuration-for-api-integrations\/","title":{"rendered":"Policy configuration for API integrations"},"content":{"rendered":"&#13;\n<p><a href=\"https:\/\/doc.viafirma.com\/documents\/models\/latest\/es\/policies\/policies.html\" target=\"_blank\" rel=\"noopener\">Policies<\/a> are understood as the set of signatures, evidences and other security elements that will determine how a document should be signed.<\/p>&#13;\n&#13;\n<p>Viafirma Documents allows so many combinations of policies that documenting all the cases that can occur would be practically impossible. Therefore, what we propose is to create a template in which we configure our policy using the <a href=\"https:\/\/doc.viafirma.com\/documents\/positionspolicy\/latest\/es\/posbydes_intro.html\" target=\"_blank\" rel=\"noopener\">visual designer<\/a> and once the policies are designed, download the JSON format through the History.<\/p>&#13;\n&#13;\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"235\" class=\"wp-image-30800\" style=\"width: 700px;\" src=\"https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image.png-4.webp\" alt=\"\" srcset=\"https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image.png-4.webp 976w, https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image.png-4-300x101.webp 300w, https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image.png-4-768x258.webp 768w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/figure>&#13;\n&#13;\n<p>From there we can download the json and from it we can get the object &#8220;policies&#8221;.<\/p>&#13;\n&#13;\n<p>Let&#8217;s see an example for the biometric signature + server signature combination.<\/p>&#13;\n&#13;\n<p>In this case, the policy object would be the following:<\/p>&#13;\n&#13;\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"515\" height=\"610\" class=\"wp-image-30802\" style=\"width: 343px; height: auto;\" src=\"https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image-2.png.webp\" alt=\"\" srcset=\"https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image-2.png.webp 515w, https:\/\/www.viafirma.com\/wp-content\/uploads\/2023\/11\/image-2.png-253x300.webp 253w\" sizes=\"auto, (max-width: 515px) 100vw, 515px\" \/><\/figure>&#13;\n\r\n<pre class=\"wp-block-code\"><code> \"policies\" : [ {\r\n      \"evidences\" : [ {\r\n        \"type\" : \"SIGNATURE\",\r\n        \"id\" : \"evidence_200\",\r\n        \"enabled\" : true,\r\n        \"helpText\" : \"Firma {{fullname}}\",\r\n        \"positions\" : [ {\r\n          \"rectangle\" : {\r\n            \"x\" : 359,\r\n            \"y\" : 354,\r\n            \"width\" : 125,\r\n            \"height\" : 90\r\n          },\r\n          \"page\" : 1\r\n        } ],\r\n        \"typeFormatSign\" : \"XADES_B\",\r\n        \"ocr\" : {\r\n          \"key\" : \"\"\r\n        },\r\n        \"addLink\" : true\r\n      } ],\r\n      \"signatures\" : [ {\r\n        \"type\" : \"SERVER\",\r\n        \"helpText\" : \"Sello Electr\u00f3nico\",\r\n        \"typeFormatSign\" : \"PADES_LTA\",\r\n        \"stampers\" : [ {\r\n          \"type\" : \"QR\",\r\n          \"width\" : 300,\r\n          \"height\" : 38,\r\n          \"xAxis\" : 57,\r\n          \"yAxis\" : 754,\r\n          \"page\" : 1\r\n        } ],\r\n        \"lastUpdated\" : 0\r\n      } ]\r\n    } ] <\/code><\/pre>\r\n&#13;\n<p>This object is the one that should be included in our code so that the policies that we have established from the designer are applied.<\/p>&#13;\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[176],"class_list":["post-37586","faq","type-faq","status-publish","hentry","category-viafirma-documents"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.viafirma.com\/en\/wp-json\/wp\/v2\/faq\/37586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.viafirma.com\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.viafirma.com\/en\/wp-json\/wp\/v2\/types\/faq"}],"version-history":[{"count":0,"href":"https:\/\/www.viafirma.com\/en\/wp-json\/wp\/v2\/faq\/37586\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.viafirma.com\/en\/wp-json\/wp\/v2\/media?parent=37586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.viafirma.com\/en\/wp-json\/wp\/v2\/categories?post=37586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}