Create a link in a Mail Merge Word document template using Aspose.Words Cloud API

Hi,

We are using the aspose cloud.
What is the merge field syntax to create a external link in the PDF.

Thanks,
Yishay


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

@yishayh

Thank you for contacting Aspose Support.

If we understood your question properly, you would like to insert an external link to a PDF document during Mail Merge. Insert HTML During Mail Merge article will help you in this regard.

Following cURL example inserts an external link to a PDF document in the template document:

// 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 HTML Data
curl -v "https://api.aspose.cloud/v1.1/words/SampleDocTemplate_Input.docx/executeTemplate?destFileName=TestPostExecuteTemplate.docx" \
-X POST \
-T TestExecuteTemplateData.txt \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer pilSfz7IlWT4zTmvpE3qztUN9MsVn2g5lRDoacx1ngr2jklNTQL6EiGMpp2wawwJlX5CDV2MTAk_nxAAhdOdlRSMUauYXFiCFTclMT-3EP-dPsZqxzKVsKbVmXmu1r64cizsng2X0tc_rPJDrG8t6MlZwcA2DuJDwmooIBF5hOpKWEgnSNCpehOy17vg4R11p6dQlo2gFcLtTIahX1Zjbb6Hrik9-ev9NbJ7MXB8QVl_G6gfYoqUYzYFq8TxwQUWIvLCLkju5uhiVuThLkoZGzMeVhSsgWmXa5Kb-W9bA4Ls1yI9p82jrYWHWEIkxKqjomzWqNEIO6ANz7XVdb4Z3ecjhYg9U9u45Q6tLRXM7teSJpHl6CB8KYNGu1PzWB3jnsI9bd-ETnMbIQDWHWQqeVp8YczwCWx3Tw2bUwkplEMEJp-G"

Input Document: SampleDocTemplate_Input.docx.zip (12.4 KB)
Mail Merge Data: TestExecuteTemplateData.txt.zip (1.0 KB)
Output Document: TestPostExecuteTemplate.docx.zip (17.7 KB)

As mentioned in the article you should escape HTML characters in data source string. You may use this website to escape HTML characters.

Please feel free to contact us if you need any further information.

Hi Sohail,

We will try that.

Thanks,
Yishay

@yishayh

If you have not noticed already, kindly note since Aspose.Words Cloud 19.4 we have released a new API version V4.0. Now it uses JSON Web Token for API request authentication and changed all idempotent methods to PUT and non-idempotent ones to POST. So Mail Merge methods are changed to PUT and also combined “ExecuteMailMerge” and “ExecuteTemplate” methods. Now API has only “mailmerge” method which can be used with both template types: “mailmerge fields” or “mustashe”. Please find the sample cURL commands for reference.

#Get JWT Access Token
curl -X POST "https://api.aspose.cloud/connect/token" 
-d "grant_type=client_credentials&client_id=xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx&client_secret=xxxxxxxxxxxxxxxxxxxx" 
-H "Content-Type: application/x-www-form-urlencoded" 
-H "Accept: application/json"

# cURL example to populate MailMerge template with Data
curl -v "https://api.aspose.cloud/v4.0/words/SampleMailMergeTemplate.docx/MailMerge?withRegions=false&destFileName=TestPostDocumentExecuteMailMerge.docx" \
-X PUT \
-F data=@SampleMailMergeTemplateData.txt \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "Authorization: Bearer <jwt token>"