Print code documentation
To begin with here is a link to the URI schema in penneo.readme.io. Here you can see how the different parts of the code can be set up. The URI schema is written in a language called JSON (JavaScript Object Notation).
If you want to see if there are some wrong characters or other errors you can validate your code in an online validator such as jsonlint.com.
Rules
Add document / #printfile#
This is used in the part of the code where you normally would set the path of the document that you want to add. But since you want to add the current document you where your are adding the code, you should instead use #printfile#. Remember this only works for the document you are putting this code in. If you want to add other documents they have to already be PDF’s and you have to set the correct file path for where they are located.
Spaces in the code
The code should not have any spaces so if you have text where there might be a space such as a name, Name Surname, you use %20 instead of the space e.g. Name%20Surname.
Merge field
merge fields can be used to fill out certain fields such as name of the case file, name of signer or email of signer. Simply copy your merge field into the correct place in the code. You can use merge fields alongside normal text, for example,
“Contract%20for%20{MERGE FIELD}”
In the example above we are merging something in behind the text Contract for.
Default
Depending on the setup, certain fields do not need to be set in the code. If you want to use the default setting then there is no need to set it in the code. An example could be the setting for what documents signers can see. As default signers can see all documents. If you want this then there is no need to set it in the code.
To start a new code you can build and write it all yourself. However the easiest way to start a new code is to open the desktop application and fill it out as you would a normal case file using a template. See the screenshot below.
In the above screenshot you can see what fields in the application I have selected.
- Some fields are static in the code, such as ‘Case File Type’ and ‘Language’.
- Other fields such as ‘Case File Name’ and ‘Signer name’ can be flexible with merge fields. We will talk about merge fields later on.
To see the code from the above template click on ‘Developer’ in the top menu and the select ‘Create integration code’. This opens a window where you can see the full code like this:
If you set a check mark in ‘Pretty print’ you can view the code in more readable formatting. However, you need the ‘compressed’ version of the code, so remember to uncheck ‘Pretty print’ before you copy.
We can now use this piece of code as a template for what we really want. Our code would look like this:
penneo:{"templateId":1,"name":"New%20print%20code","language":"en","folderId":1355944,"sensitiveData":true,"documents":[{"name":"Test%20dokument","order":0,"typeId":1,"localPath":"C:\\Users\\[USERNAME]\\Documents\\Test%20dokument.pdf"}],"signers":[{"name":"New%20Signer","email":"mail@mail.com","isPrivate":true,"roles":["1"],"reminderInterval":2}],"schemaVersion":"2.0.0"}
Let's break the code down to smaller pieces. These pieces can also be seen in the documentation at penneo.readme.io.
The full JSON code is surrounded by { } and inside those the code is written. Every section can be used without the other though some sections are reliant on other sections already being defined. For example Document type requires Case file type to already be defined and Signer role is relying on Document type already being defined.
Some fields are being populated with an ID and some by “normal” text.
Penneo: is being used to call Penneo. This is always needed in the front of the code.
templateId: This is the ID for the case file type you wanna set.
name: You will see “name” several places in the code. Here it is for naming the case file. Remember the rules about spaces. merge field can be used here.
language: Set the language of the case file. Options are, en = English, da = Danish, sv = Swedish, no = Norwegian.
folderId: Set the folder ID for the folder you wanna save the case file to. The default is your selected standard folder.
signOnMeeting: Select to activate the feature, Sign documents at the meeting. Variables are, true or false. Default is false.
sensitiveData: Select if the case file has sensitive data activated. Variables are, true or false. Default is false, unless it is activated on a company level. Ask your administrator about this.
visibilityMode: Sets what documents the signers can see. There are 2 settings, all_documents and certain_documents. Default is all documents
messageTemplate: Write the name of the email template you want to use.
messageSubject: Set the subject of the email you want to send to the signers. Not necessary if you have selected an email template.
messageText: Set the body of the email that you want to send to the signers. Not necessary if you have selected an email template.
documents: This next section is all about the documents that are added to the case file.
name: Once again we see name, but this time it is for naming the document. Remember the rule about spaces. merge field can be used here.
order: This sets the order in which the documents are added to the application. It counts from 0, e.g. 0 will be the first document, 1 will be the second document and so on.
type: The ID of the document type that is available from the case file type. This is dependent on the case file type that is selected with templateId.
localPath: This is the file path for the PDF you want to add. If the document you want to add is already the document this code is in and you are printing it, you use #printfile# to tell the system that it is the text document you are in.
signers: The next is about the signers that are being added to the case file in the desktop application.
name: This is the name of the signer. Remember the rule about spaces. merge field can be used here.
email: The email address of the signer. merge field can be used here.
onBehalfOf: Inputs data in the field for “on behalf of” for the signer. Remember the rule about spaces. merge field can be used here.
isPrivate: Enable the private setting for the signer. Can be either true or false.
enableTouch: Enable touch signature for the signer. Can be either true or false
roles: Set the ID’s for the roles the signer should have. These are dependent on the document types that have been selected with documents. ID’s are separated by a comma (,).
ssn: Set the Social Security Number for the signer. merge field can be used.
vatin: Set the company number for the signer. This is only for certain Danish signers. merge field can be used here.
reminderInterval: Set the reminder interval for the signer. Defaut is 2, unless something else has been selected for your company. Ask your administrator about this.
copyRecipients: You can set copy recipients if you have any of those. They are set up the same way as signers but only with name and email address.
name: Set the name of the copy recipient. Remember the rule about spaces. merge field can be used here.
email: The email address of the copy recipient. merge field can be used here.
sendAt: Set the date and time for the when you want to activate the case file. If you want it activated right away, ignore this setting. Remember to account for summertime. If you want to set a date such as 31/12-2020, the format should be: 2020-12-31T12:00:00+01:00
The last part with +01:00 is the summertime off. If it is on there should be +02:00.
expireAt: Set the date and time for when the case file should expire. Cannot be earlier than activation date and time. Same rules for sendAt date and time apply for this.
reference: Set the reference you want here. Remember the rule about spaces. merge field can be used here.