Push PDF document from external application to SimpleSIgn
In this walk-through example, we guide you through the following use case:
From an external web application, ask a user to digitally sign a PDF document using his local SimpleSign application. Once the PDF document has been locally signed by the user, the external application will receive the document using a callback URL.
To upload a PDF file, you can use the download function
The result of the file upload, is that the file will be uploaded (from the application point of view) to the SimpleSign exchange folder.
The request above is sent to 'download' as the naming is done from a user perspective. Don't be confused, when an application pushes a new PDF document, 'download' endpoint is the correct one 👍
The response will return the information of the file uploaded. This is important as you will need to use the name in the request for adding context information.
When you try to upload a file which already exists in the SimpleSign folders or Database it will automatically rename the file for you. The response will contain the new name in the name property and the full path to the file in the path property.
After the preceding request, nothing will happen, until the external application pushed the context information as well.
This can be done by sending a request to the SimpleSign CMS module:
After a successful request of the latter, the PDF document will be picked up by SimpleSign and will be available in the user's Inbox folder 👏.
You can choose to not receive the actual file in the callback by adding the sendFile property and setting it to false.
This will send the callback not in Multipart form-data but as JSON, the name can then be used with the Download function to get the actual PDF document.
An example json with sendFile propety being false (not returning with Multipart form-data);
Receive Signed PDF document
When the document has been signed, the SimpleSign CMS module will send the document information to the defined callback.
Depending on the sendFile property this will be in either application/json or in form-data
The response as Multipart;
The response as JSON;
If you have chosen to get the signed document information as JSON you will need to retrieve the file via the SimpleSign CMS API.
This can be done with the download endpoint. The filename property will be the file received in the callback