Microsoft Word Document Mail Merge with Mustache Template using Aspose.Words REST API

Hi,

Please see that attached file.
When we send this with the attached template we get URI too long error.

Defects.zip (781.7 KB)

Thanks,
Yishay


This Topic is created by sohail.aspose using the Email to Topic plugin.

@yishayh

The API is working perfectly fine with your input documents. You may test the API with the following cURL example:

// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d 'grant_type=client_credentials&client_id=0B17F60A-6D69-426B-9ABD-79F35A6E9F7B&client_secret=53b8b19adffa41a3e87dbbd8858977ae' \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
  
// cURL example to populate Mustache Template with Data
curl -v "https://api.aspose.cloud/v1.1/words/Defect List template en.docx/executeTemplate?destFileName=TestPostExecuteTemplate.docx" \
-X POST \
-T string_too_long.txt \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer cKFHq2isv7pjQU6P6Orkkwv2Y7Oo5nobVAL2SOBf3hOfHBWEgl2RaDj9r-R5z0t5x4U1veCSoDJ84EeD5WDK91CnUOeeVhaA9Yrjp4Fe9EEwFNBXEJS4NKgeBPPttbAYBoLxDqMroIGK8dL9rB0x35E72MtK59N7zJJY0uxrmm6npsoVXluGS45MOi9rlIiXjQ27BQIZxg9Ak_rrw9QIk2GrkKYR0AhqGqi4nCv8a8DHZguQ7FZSYR0qkl5xnjAIwB1FHcK-FVXP0G480_1PWyfKw_FTwGF-kk3AiUdank1gSvIrH4KzWDivP89r2ztjJH8LgQNNWfNy3tvO4SLC0mJNRfIsrfJp1AQTI7q46ICKU8Dc2L1d2sPdvqAM2kv45AAlgBEElFjnK5abLj3A-SfAUdaXerj5SOjrJ6oPDssTfqXfdYDSHEzS1D1MsxKjDj0asqV3uyp_hdUeMSsFBENR12M"

Input Document: Defect List template en.docx.zip (18.4 KB)
Mail Merge Data: string_too_long.txt.zip (765.2 KB)
Output Document: TestPostExecuteTemplate.docx.zip (1.4 MB)

Hi @sohail.aspose,

We use the API from another server and the string_too_long.txt is passed as the body of the message.
I’m not sure how this example helps us.

Thanks,
Yishay

@yishayh

The cURL example explains how you should call the API. Moreover, you can use our Cloud SDKs to test the API as well:

@sohail.aspose
We use the API for almost 4 years now, I don’t see how this is going to help us.
We didn’t changed the usage, but with the above example we get an exception on your cloud service, and we need your help in order to understand what’s wrong.

Thanks,
Yishay

@yishayh

Please share the code that you are using to call the API. Please also share what programming language and the Cloud SDK version you are using. These details would help us in reproducing the issue on our end.

We have marked this thread private, only you and Aspose Staff have access to it.