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!
Thankyou very much!
I’m just not getting it to work just yet.
I have 2 of the same warning because some create method is deprecated… Screenshot_1.png (6.5 KB) Screenshot_2.png (116.6 KB)
Also, when i try to start it, I’m getting an error: Screenshot_3.png (12.8 KB)
Im running latest okhttp3 version , 4.9.0.
Hopefully you can see what i did wrong.
I have used the OkHttp 3.9 version with JDK 1.8 in above shared example. For the OkHttp3 4.9.0 issue please swap the arguments of the create method as following it will resolve the deprecation warning.
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("Template", "SampleMailMergeTemplate.docx",
RequestBody.create(TemplateFile, MediaType.parse("application/vnd.openxmlformats-officedocument.wordprocessing")))
.addFormDataPart("Data", "SampleMailMergeTemplateData.txt",
RequestBody.create(DataFile, MediaType.parse("txt/plain")))
.build();
However for the second error. Please google the error and try the suggested solutions. Hopefully, it will resolve the issue.
Thankyou very much!
I managed to get the merge done without any issues!!.
Futhermore I would like to know if it’s possible to upload a word document just like the mail merge but then with the feature Replace document text.
As you can see in the cURL example the word file is (i think) located in the aspose cloud storage it self and there is only one word that’s to be replaced.
I would like to implement this like you upload a file (just like the mail merge) and can change multiple values with new values. In the example you see one valua that’s being changed, but i would like to know if you can just change any number of values for different ones.