Create a Markup Room
This guide will walk you through the process of creating a Markup Room using the eNotaryLog API. You'll need your API access token to proceed.
Requirements
- You need to have Node.js installed on your system.
- You'll also need the axios library. You can install it using the following command:
npm install axios
Step 1: Upload Document
Use the following code snippet to upload a document. Replace <accessToken>
with your API access token and provide the path to the PDF document you want to upload.
const axios = require("axios");
const fs = require("fs");
const filePath = "path/to/your/document.pdf";
const config = {
method: "post",
url: "https://public-api.enotarylog.com/documents/upload",
headers: {
Authorization: "Bearer <accessToken>",
"Content-Type": "multipart/form-data",
},
data: fs.createReadStream(filePath),
};
axios(config)
.then(function (response) {
console.log("Document uploaded successfully:", response.data);
// Proceed to Step 2: Create a Markup Room
})
.catch(function (error) {
console.log(error);
});
Step 2: Create a Markup Room
After successfully uploading the document, use the file ID from the response in the following code snippet to create a Markup Room. Replace <accessToken>
with your API access token and <fileId>
with the file ID obtained from the document upload response.
Remember to replace <accessToken>
, <fileId>
, <senderId>
, and other placeholders with your actual values.
const axios = require("axios");
const data = {
config: {
idv: {
kba: false,
credentialAnalysis: false
},
authentication: {
personalPassword: false,
twoFactor: false
},
documents: {
rename: true,
edit: true,
advancedEdit: true
},
participants: {
add: true,
edit: true,
remove: true
}
},
participants: [
{
firstName: "John",
lastName: "Doe",
email: "john.doe@gmail.com"
}
],
documents: [
"{{<fileId>}}"
],
senderId: "{{<senderId> a user ID from your organization}}"
};
const config = {
method: "post",
url: "https://public-api.enotarylog.com/esign/create-markup-room",
headers: {
Authorization: "Bearer <accessToken>",
"Content-Type": "application/json",
},
data: JSON.stringify(data),
};
axios(config)
.then(function (response) {
console.log("Markup Room created successfully:", response.data);
})
.catch(function (error) {
console.log(error);
});
Response
The response data from the "Create a Markup Room" API request (POST) contains the URL of the created Markup Room. You can use this url to load the markup room into an iFrame on your own webpage.
{
"url": "https://markup.enotarylog.com/markup-room/fb899ced-14ee-4896-9918-8d05f74ff4a9",
"config": {
"idv": {
"kba": false,
"credentialAnalysis": false
},
"authentication": {
"personalPassword": false,
"twoFactor": false
},
"documents": {
"rename": true,
"edit": true,
"advancedEdit": true
},
"participants": {
"add": true,
"edit": true,
"remove": true
}
}
}
Steps to Execute the Code Snippets
- Create a new file named
create_markup_room.js
. - Copy and paste the code snippets provided above into the new file, replacing
<accessToken>
,<fileId>
,<senderId>
, and other placeholders with your actual values. - Save the file and open a terminal or command prompt.
- Navigate to the folder where you saved the
create_markup_room.js
file. - Run the following command to execute the script:
node create_markup_room.js
If the requests are successful, you'll see messages indicating that the document was uploaded successfully and the Markup Room was created successfully, along with the respective response data that includes the url. In case of an error, the error messages will be displayed instead.
Additional Resources
For more information about the eSign API, visit the official documentation.
If you need further assistance or have questions, feel free to reach out to our support team.