I’m looking for a mail merge tool and came across Aspose Word Online to work with cURL’s.
Unfortunately the documentation isn’t very clear on how to work with different file locations.
I’m a beginner in programming so sorry in advance for things I might not get right away.
Here is the documentation regarding the mail merge but cant seem to get it to work.
I have the template and the data files stored locally but can’t get cURL to find the location,
Your cURL command is fine but it seems you are getting an issue because of the space in the path. Kindly enclose the path in double quotes as following, it should resolve the issue.
Thankyou very much for you reply!
For testing at the moment im using the curl commands in git bash.
The Double quotes didn’t help but i’ve moved the files to a location without a space and when using your example the command worked.
However right now I’m getting back an empty word document.
It does have the MailMergeOnline name but there is nothing inside.
Any idea what to do with that?
I’m afraid the cURL command in git bash is working fine at my end. It is quite difficult to suggest anything without replicating the issue at my end. Can you please try the ExecuteMailMergeOnline API method using API explorer in your browser and share the results?
It is quite strange. Can you please confirm your git bash version and your OS details? We will try to replicate the issue at our end. Meanwhile, you may please try the API call in Postman?
Did file rename of download file to xxx.docx work for you?
Hi, my git bash its the newest version, so that will be 2.28.0 64-bit for windows 10
When trying with postman, I import the raw data and i’m getting status 401. Do i need to edit some things? Screenshot_10.png (26.3 KB)
Futhermore when i change the download file to for example mailmerge.docx it works and the file is ok.
How is it possible that i need to do that? because it’s not that convenient to do that everytime.
I’m using 2.25.1 64-bit for windows 10. I will double check with the latest version.
For passing authentication token in the postman, please use the authorization tab and to run API use Send and Download option instead of Send. Please check the following screenshots for details. Hopefully it will help you to test the API in the postman.
Hi, Using postman im able to get the merged file back so that seems to work!
Right now the response file is called ‘result’.
Is it possible to specify the outcome name like i was doing in cURL with git bash (which still doesn’t work), or does that normally work but just not in postman?
When making a call from my program i would like to save a file e.g. in a file server where i can specify the location and name of the file.
But i don’t know if both requirements are a problem or not.
I have upgraded my git bash version to 2.28.0 and ExecuteMailMergeOnline API method is working as expected in it.
I doubt there is some issue with your JWT token used in the cURL command. Please run ExecuteMailMergeOnline API method in API Explorer, copy the cURL command from the API method, replace “-d {“Template”:{},“Data”:{}}” with “-F “Template=@C:/Test/SampleMailMergeTemplate.docx”
-F “Data=@C:/Test/SampleMailMergeTemplateData.txt”
–output C:/Test/MailMergeOnline.docx” and run it in the git bash. Hopefully it will resolve the issue.
Can you please share some details? On which platform are you using Aspose.Words REST API? Because we have SDKs for different platforms to use Aspose.Words Cloud API directly in your programming language. We can share a working example with you.
I’m not looking to work with the SDK, but with the API Call, the cURL method.
At the end i would like to select a template and data from my storage, probably an online database and send these 2 files with the call to your service. Then I would like to recieve the merged file and save it again in our database/server.
The program will be written in Java and from there we want to make the API call.
Good to know that you managed to cURL issue at your end. So it means you were getting the issue because of your expired token. Please note JWT Token has 24 hours lifetime and it expires after it. So if you are calling the API yourself via some rest client then you need to keep this in mind and regenerate the JWT token accordingly. However, we have taken care of this in Aspose Cloud SDKs.
Hi, I know about the token and that it can expire, but that wasn’t my problem.
I’ve compared the 2 cURL calls with each other and found out that i kept the <> markers in the call where the token is located. after removing them it worked
I don’t know if i’ts possible, but can you guys maybe give me a working example of making an API call in java? So not using the SDK but with the cURL method? Would be much appreciated!