Flujo Plantillas V1

Flujo de trabajo

1. Generar Token

curl --location --request POST 'https://api.weetrust.mx/access/token' \
--header 'user-id: YY0mSXZX3WUPmvHvolHfcLTGvaaa' \
--header 'api-key: b43855513bce9498db596bdb2ca84092653a5555'

2.- Obtener plantillas

curl --location 'https://api.weetrust.mx/templates' \
--header 'token: token' \
--header 'user-id: YY0mSXZX3WUPmvHvolHfcLTGvaaa' \
--header 'Authorization: Bearer token'

Respuesta:

{
    "responseData": {
        "templates": [
            {
                "_id": "6425db28ebb341c2037016ff",
                "userID": "9eazxC7xPYTcEqKUFfi7L5vp5sd2",
                "name": "Documento de prueba con usuario y formulario",
                "description": "Documento con campo para usuario y formulario",
                "templateID": "6425db28ebb341c2037016ff",
                "inputs": [
                    {
                        "key": "empresa",
                        "type": "text",
                        "isRequired": true,
                        "label": "Empresa"
                    },
                    {
                        "key": "RFC",
                        "type": "text",
                        "isRequired": false,
                        "label": "RFC"
                    }
                ]
            }
        ]
    },
    "success": true,
    "responseCode": 200
}

El siguiente paso es obtener el templateID y el inputs, el inputs son las variables que necesitamos llenar para el estampado de las variables en la plantilla.

3.- Enviar documento desde plantilla a firma

curl --location 'https://api.weetrust.mx/templates/createDocumentByTemplate' \
--header 'token: token' \
--header 'user-id: 9eazxC7xPYTcEqKUFfhhL5vp5eU3' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer token' \
--data-raw '{
    "templateID": "6425db28ebb341c2037016ff",
    "country": "México",
    "inputs": {
    	"empresa": "Example",
      "RFC": "RFC Example"
     },
    "signatories": [
        {
            "email": "[email protected]",
            "name": "example"
        }
    ],
    "staticSignPositions": [
        {
            "user": {
                "email": "[email protected]"
            },
            "coordinates": {
                "x": 252.80990304709144,
                "y": 481.19009695290856
            },
            "page": 2,
            "pageY": 481.19009695290856,
            "pageYv2": 481.19009695290856,
            "color": "#FFD247",
            "imageSize": {
                "width": 112.50588642659285,
                "height": 56.80990304709144
            },
            "parentImageSize": {
                "width": 612,
                "height": 792
            },
            "viewport": {
                "width": 612,
                "height": 792
            }
        }
    ]
}'

Esto detonara un correo que se le enviara al firmante con la url de firma para proceder a flujo de firma.