The first step is to upload the content you want to be signed. This can be a PDF, a raw text file (e.g. a privacy policy), a JSON file or a specialized IOU format (debt acknowledgment).
To upload a file, we offer a pre-signed URL that allows you to upload the file directly to our storage infrastructure.
filePath: The path to the file you want to upload. Each organization has its own root directory and files are versioned to ensure they are not overwritten.
md5Checksum: The MD5 checksum of the file you want to upload. This is used to verify the integrity of the file so it is not corrupted during the upload process.
Once you get a response, you can use the url to upload the file and the key to reference it when you create the signature request.
For example, to upload a simple text file, you can use the following process:
Copy
import { md5, util } from "node-forge";import axios from "axios";import plumaaClient from './plumaa-client'// Our message. It is salted to ensure uniquenessconst saltedMessage = `Some message you want to get signed. Salt: _${Date.now()}_`// Obtain the message MD5 checksumconst md5Checksum = md5 .create() .update(util.createBuffer(saltedMessage, "utf8").bytes(), "raw") .digest() .toHex();// Updateconst { data } = await plumaaClient.signFileUrl({ filePath: `/free/${Date.now()}.txt`, md5Checksum,});// Upload the fileawait axios.put(data.url, saltedMessage, { headers: { "Content-MD5": util.encode64(util.hexToBytes(md5Checksum)), },});
Copy
import { md5, util } from "node-forge";import axios from "axios";import plumaaClient from './plumaa-client'// Our message. It is salted to ensure uniquenessconst saltedMessage = `Some message you want to get signed. Salt: _${Date.now()}_`// Obtain the message MD5 checksumconst md5Checksum = md5 .create() .update(util.createBuffer(saltedMessage, "utf8").bytes(), "raw") .digest() .toHex();// Updateconst { data } = await plumaaClient.signFileUrl({ filePath: `/free/${Date.now()}.txt`, md5Checksum,});// Upload the fileawait axios.put(data.url, saltedMessage, { headers: { "Content-MD5": util.encode64(util.hexToBytes(md5Checksum)), },});
The creation endpoint includes a draft flag that allows you to create a signature request without sending it to the signers. Requests can be sent later by updating this field to false using the PUT /signature-request/ endpoint.
As you may notice, the content field is not fulfilled in the example above.
To create a signature request with a raw text content, you can use the following example. Note the key is that returned from the sign-file-url endpoint:
To create a signature request with a raw text content, you can use the following example. Note the key is that returned from the sign-file-url endpoint:
An IOU content is a specialized version of a raw text. However, it has a predefined template that includes the relevant information create compliant IOU in terms of Mexican regulation.
To create a signature request with a IOU content, you can use the following example. Note the key is that returned from the sign-file-url endpoint:
Although the IOU will register some values like amount and currency. It’s possible to construct an IOU where the raw text doesn’t include these values. The way the IOU is constructed is responsability of the organization.
Once you have created a signature request, you can send invites to the signers. Each invite is tracked individually and will show up in the mobile app for the signer and the webapp for the organization.
To get the subject id, you can use the GET /subject endpoint. Consider that a link between the subject and the organization must exist before creating the invite.