Mail Merge Online with Salesforce Apex returns 404 / cannot use Storage files in v4 API

I am trying to perform a Mail Merge using Aspose.Words Cloud API v4 from Salesforce Apex. My goal is:

  1. Take a DOCX template and XML data (currently stored as Salesforce Static Resources or already uploaded in Aspose Storage).
  2. Execute Mail Merge to generate a PDF.
  3. Obtain the PDF as Base64 and/or a download URL in Salesforce.

I have tried the following approaches:

  • Using the MailMerge class from the Aspose Salesforce sample (Utils.cls) with ExecuteMailMerege() pointing to files in Aspose Storage. This returns 404 Not Found.
  • Attempting direct REST callouts to /words/{filename}/executeMailMerge and /words/mailMerge endpoints. Also returns 404.
  • Generating an access token works fine, and I can list Storage folders and files correctly.

It seems that in v4, the library or endpoints do not support performing Mail Merge using files already in Storage from Salesforce Apex.

My question:

  • What is the correct way to perform Mail Merge in Salesforce Apex using files in Aspose Storage with v4 API?
  • Can I use MailMerge.ExecuteMailMerege() with Storage files, or do I have to send the template and XML “online” in the request?
  • Is there an example for Salesforce Apex that performs Mail Merge with Storage files and returns PDF (Base64 or download URL)?

Thank you!

Please share the code you use, so I can change it. But answers to your questions are:
Firstly, you may look at the reference page Aspose.Words Cloud Api reference, where you can find all the parameters you can specify

  1. You should invoke https://api.aspose.cloud/v4.0/words/MailMerge if you want to pass data as an XML file, you specify the Data parameter, or the other way, if you want to use a stored file MailMergeDataFile parameter is responsible for that
  2. Yes, you can do both, which way is more convenient for you
  3. Share your code and help you with this.