Últ. revisión: 06 ago 2018
Como integrador tienes 2 alternativas para usar políticas:
Como integrador podrás facilitar tu trabajo apuntando a un código de políticas que previamente ha sido diseñado y gestionado en el backend de viafirma documents. De esta forma, sólo tendrás que definir qué documento enviar y a quién.
"document" : {
templateType:"url",
templateReference:"https://www.viafirma.com/myPDF_sample.pdf",
policyCode:"myPolicyCode_sample_001"
}
{
"notification" : {
"text" : "Nuevo contrato pendiente de firma",
"detail" : "Cliente con ref. A1882",
"notificationType" : "PUSH_IOS",
{
"devices" : [ {
"appCode" : "com.viafirma.documents",
"code" : "customer_care_ipad01",
"type" : "IOS",
"userCode" : "[email protected]"
} ]
}
},
"document" : {
templateReference:"https://www.viafirma.com/myPDF_sample.pdf",
templateType:"url",
policyCode:"myPolicyCode_sample_001"
},
"workflow" : {
"type" : "APP"
}
}
En el ejemplo anterior, el documento está referenciado en una URL, y se aplicará la política de firma con código "myPolicyCode_sample_001", política que previamente ha debido ser creada y diseñada en el backend de viafirma documents.
Si no puedes referenciar a una política existente tendrás que definirla explícitamente en el servicio. Para ello tendrás que gestionar el objeto POLICY.
Política de ejemplo que informaremos de forma explícita en nuestro mensaje:
"policies" : [ {
"evidences" : [ {
"type" : "SIGNATURE",
"helpText" : "Firma de {{cliente}}",
"typeFormatSign" : "XADES_B",
"positionsKey" : "firma_place"
} ],
"signatures" : [ {
"type" : "SERVER",
"helpText" : "",
"typeFormatSign" : "PADES_B",
"stampers" : [ {
"type" : "QR_BARCODE128",
"rotation" : "ROTATE_90",
"positionsKey" : "stamper_place"
} ]
} ]
} ]
El mensaje con la política usada de forma explícita quedaría de la siguiente forma:
{
"notification" : {
"text" : "Nuevo contrato pendiente de firma",
"detail" : "Cliente con ref. A1882",
"notificationType" : "PUSH_IOS"
{
"devices" : [ {
"appCode" : "com.viafirma.documents",
"code" : "customer_care_ipad01",
"type" : "IOS",
"userCode" : "[email protected]"
} ]
}
},
"document" : {
"templateReference" : "https://www.viafirma.com/myPDF_sample.pdf",
"templateType" : "url"
},
"policies" : [ {
"evidences" : [ {
"type" : "SIGNATURE",
"helpText" : "Firma del cliente",
"typeFormatSign" : "XADES_B",
"positionsKey" : "signature_box"
} ],
"signatures" : [ {
"type" : "SERVER",
"helpText" : "",
"typeFormatSign" : "PADES_B",
"stampers" : [ {
"type" : "QR_BARCODE128",
"rotation" : "ROTATE_90",
"positionsKey" : "stamper_box"
} ]
} ]
} ],
"workflow" : {
"type" : "APP"
}
}