Automate Your Document Workflows with OfficeExport API

Today, I would like to introduce you to my OfficeExport API that I have just made public. It allows you to transform Office document templates into finished documents through a tagging system. For example, the tag {{city}} in a template will be replaced with its corresponding value in your JSON. This enables the automation of mail merging for Word, Excel, or PowerPoint documents while maintaining the original formatting. The tool allows you to replace tags with text, tables, and even images. You can find all the details of the features on https://www.broggisoft.com.

API:

The OfficeExport API is accessible via the following URL: https://www.broggisoft.com/api/OfficeExport. It supports Word, Excel, and PowerPoint documents.

Http Method: POST

FormData:

document: Your template containing tags. Examples below.

jsonData: Your object in JSON format containing corresponding values. Examples below.

  • Word: {“name”:”John Smith”,”address”:”120 Main Street”,”city”:”New York”,”subject”:”Newsletter”,”publishingCity”:”Paris”,”publishingDate”:”8 May 2022″}
  • PowerPoint: {“title”:”Annual sales report”,”editor”:”John Smith”,”section1″:”Eum perferendis officia ex ullam beatae et rerum saepe. Et dignissimos odit ut neque modi sed corrupti quidem eum quia possimus. Qui harum sint a doloribus nihil qui enim maiores?”,”section2″:”Rem officia consequatur a minus ratione sit ipsum vero sed architecto error. Ut ipsum minus nam odit cupiditate ut adipisci quos qui quos dolores est dolor provident.”,”lines”:[{“year”:2022,”sales”:”1 480 975$”,”expenses”:”784 253$”,”netIncome”:”696 722$”},{“year”:2021,”sales”:”1 245 365$”,”expenses”:”623 800$”,”netIncome”:”621 565$”},{“year”:2020,”sales”:”1 056 010$”,”expenses”:”510 450$”,”netIncome”:”545 560$”}]}
  • Excel: {“name”:”John Smith”,”address”:”120 Main Street”,”city”:”New York”,”invoiceNumber”:”20220110001″,”date”:”03/31/2022″,”subtotal”:”$79.99″,”tax”:”$15.99″,”shipping”:”$4.99″,”total”:”$100.97″,”namesheet”:”Invoice 1″,”product”:[{“name”:”Product 1″,”qty”:”1″,”price”:”$79.99″,”total”:”$79.99″},{“name”:”Product 2″,”qty”:”2″,”price”:”$10″,”total”:”$20″}]}

Code Examples: Below, find an example of using the OfficeExport API in JavaScript:

const formData = new FormData();
const templateFileInput = document.querySelector(‘#templateFileInput’);
const templateFile = templateFileInput.files[0];
formData.append(‘document’, templateFile);

const jsonData = { name: “John Smith”, address: “120 Main Street”, city: “New York”, subject: “Newsletter”, publishingCity: “Paris”, publishingDate: “8 May 2022” };
formData.append(‘jsonData’, JSON.stringify(jsonData));

fetch(‘https://www.broggisoft.com/api/OfficeExport’, { method: ‘POST’, body: formData }) .then(response => response.blob()) .then(blob => { // Process the resulting blob (for example, save it as a file) // … }) .catch(error => console.error(‘Error:’, error));

Swagger: Explore the OfficeExport API with the interactive Swagger documentation: https://www.broggisoft.com/api/swagger/index.html

API Usage Limitations: The API is free but is currently limited to 100 calls every 5 minutes. This limitation allows for fair use and optimal performance for all users. If you need higher limits or have specific needs, please feel free to contact me. Privacy: Priority is given to your privacy and the security of your data. Rest assured that no documents or data are retained after the completion of the process. All submitted templates and JSON data are processed in real-time and are not stored, ensuring that your information remains confidential.

Support and Contact: For any requests, encountered problems, or suggestions for improving the OfficeExport API, please do not hesitate to contact me at contact@broggisoft.com.

Conclusion: The OfficeExport API is the solution if you are looking to automate newsletters, financial reports, or any other type of document. After recognizing this need among several of my clients, I decided to develop a solution. Users can manage and update their documents, while developers only need to provide the data model. This saves time, reduces errors, and allows for document customization. As a reminder, all these features are directly accessible through the Nuget package BroggiSoft.OfficeExport for .NET developers.


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *