Document from a template

Modified on Tue, 15 Sep at 11:52 AM

Instead of a finished file, you can create a document from a template — a template stored in Signi with fill-in fields. Through the API you then send only the field values, no file.

Templates are a paid extension of the Signi service.

Creating templates

You can create templates in the app using the Template Editor. A template contains the document text with fill-in fields — through the API you then just insert values into the fields.

How it works

In the JSON instructions, instead of the file field you use template — the template ID and the values of its parameters:

{
    "people": [
        {
            "is_proposer": true,
            "email": "vas@email.cz",
            "contract_role": "sign"
        },
        {
            "is_proposer": false,
            "party_order": 2,
            "email": "protistrana@email.cz",
            "contract_role": "sign",
            "first_name": "Jan",
            "last_name": "Novák",
            "person_type": "legal"
        }
    ],
    "template": {
        "id": 8,
        "parameters": [
            { "id": "11", "value": "Praha" }
        ]
    }
}

The call is then simpler — only JSON is sent, without a file:

curl -X POST "https://api.signi.com/api/v1/contract/" \
  -H "x-api-key: VAS_API_KLIC" \
  -F "data=@dokument.json;type=application/json"

What party_order is for

A template has predefined contracting parties (e.g. client and contractor). party_order says which template party a person belongs to — the party number. In the example above, the counterparty is party no. 2.

You don't have to worry about signature positions — they are defined by the template.

A specific example

Try filling in a Consent to electronic communication — download the sample JSON (replace the emails and phone with your own):

{
    "contract_name": "Souhlas s elektronickou komunikací - Test Tester",
    "locale": "cs",
    "state": "pending",
    "settings": {
        "signing_order": "all_at_once",
        "autosign_proposers": "V Praze"
    },
    "people": [
        {
            "is_proposer": true,
            "email": "test@signi.com",
            "contract_role": "sign"
        },
        {
            "is_proposer": false,
            "email": "test+1@signi.com",
            "contract_role": "sign",
            "phone": "603123456",
            "first_name": "Test",
            "last_name": "Tester",
            "person_type": "nature"
        }
    ],
    "template": {
        "id": "2105",
        "parameters": [
            { "id": "101", "name": "Jméno / Název společnosti", "value": "Test Tester" },
            { "id": "102", "name": "Adresa / Místo podnikání", "value": "Testovací 123, 110 00 Praha" },
            { "id": "103", "name": "Datum narození / IČO", "value": "8.8.2006" },
            { "id": "131", "name": "Název", "value": "Ukázková firma s.r.o." },
            { "id": "132", "name": "IČO", "value": "12345678" },
            { "id": "121", "name": "např", "value": "pracovní smlouvy, dohody, mzdové výměry" },
            { "id": "141", "name": "Pro společnost", "value": "Ukázková firma s.r.o." },
            { "id": "142", "name": "IČ", "value": "12345678" },
            { "id": "143", "name": "Sídlo", "value": "Firemní 1, 110 00 Praha" },
            { "id": "151", "name": "Email", "value": "test+1@signi.com" },
            { "id": "152", "name": "Telefon", "value": "603123456" }
        ]
    }
}

Note the fields contract_name (document name), locale (communication language) and settings.autosign_proposers — the proposer signs automatically, only the place of signature is added.

Sending:

curl -X POST "https://api.signi.com/api/v1/contract/" \
  -H "x-api-key: VAS_API_KLIC" \
  -F "data=@vzor-souhlas-el-komunikace.json;type=application/json"

What you get back:

{
    "contract_id": 1234567,
    "state": "pending",
    "notifications": [
        { "email": "vas@email.cz",
          "links": { "contract": "https://app.signi.com/dashboard/workspace/…/documents/1234567" } },
        { "email": "protistrana@email.cz",
          "links": { "contract": "https://app.signi.com/signing/…/received" } }
    ]
}
  • contract_id — the document ID for further calls (status, download).
  • notifications — links for individual people: the proposer to the workspace, the counterparty directly to the signing page. You can display the link to the counterparty right in your app, so they don't have to wait for an email.

Where to find the template and parameter IDs

The list of workspace templates is returned by:

curl -H "x-api-key: VAS_API_KLIC" https://api.signi.com/api/v1/contract/templates
{
    "templates": [
        {
            "id": 123,
            "name": "Souhlas s elektronickou komunikací",
            "parameters": [
                { "id": "101", "type": "con-textarea", "name": "Jméno / Název společnosti", "values": null },
                { "id": "131", "type": "con-options", "name": "Předmět smlouvy", "values": ["první", "druhá"] }
            ]
        }
    ]
}

For each template you see the ID and a list of parameters — the con-options type means a selection from the values in values.

Where to go next

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article