Skip to main content

Download Notarized Document

After the notarization process is complete, you can download the notarized document using the Notarization API. You'll need both the notarization ID that is found in the response body when creating a notarization and your API access token to proceed.

Requirements

  1. You need to have Node.js installed on your system.
  2. You'll also need the axios library. You can install it using the following command:
npm install axios

Code Snippet

Use the following code snippet to download the notarized document. Replace <notarizationId> with the actual notarization ID, and <accessToken> with your API access token.

const axios = require("axios");
const fs = require("fs");

const config = {
method: "get",
url: `https://public-api.enotarylog.com/notarizations/<notarizationId>/download`,
headers: {
Authorization: "Bearer <accessToken>",
},
responseType: "stream",
};

axios(config)
.then(function (response) {
const file = fs.createWriteStream("notarized_document.pdf");
response.data.pipe(file);
file.on("finish", function () {
console.log("Notarized document downloaded successfully");
});
})
.catch(function (error) {
console.log(error);
});

Steps to Execute the Code Snippet

  1. Create a new file named download_notarized_document.js.
  2. Copy and paste the code snippet provided above into the new file.
  3. Replace <notarizationId> and <accessToken> with the appropriate values.
  4. Save the file and open a terminal or command prompt.
  5. Navigate to the folder where you saved the download_notarized_document.js file.
  6. Run the following command to execute the script:
node download_notarized_document.js

If the request is successful, the notarized document will be downloaded and saved as 'notarized_document.pdf' in the same folder. In case of an error, the error message will be displayed instead.

Additional Resources

For more information about the Notarization API, visit the official documentation.

If you need further assistance or have questions, feel free to reach out to our support team.