'Can I create Google Doc using template and merge fields using API endpoints instead of using client?

I have an existing template Google Doc with merge fields like {{First Name}} and I want to create a document using that template and fill the merge fields using values in javascript. Can I achieve this using the API endpoints instead of the client SDK or library?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source