PDF
Download PDF
Download page Merging Documents.
Merging Documents
This API allows you to merge multiple documents into a single document. The supported file types are DOC, DOCX, XLS, XLSX, PPT, PPTX, and PDF.
API | Signature |
---|---|
mergeDocuments | webService static Id mergeDocuments(Apttus.CustomClass.ActionParams params) |
Request Parameters | |||
---|---|---|---|
Name | Type | Description | Required? |
SessionId | ID | The Salesforce Session ID. | Yes |
SessionUrl | String | The Salesforce Server URL. | Yes |
sObjectId | ID | The ID of the standard object. | Yes |
ParentId | ID | The ID of the parent object associated with the result. | Yes |
Attachments | List<Apttus.CustomClass.AttachmentInfo> | List of all documents in the order to be merged. | Yes |
ExternalLinks | List<Apttus.CustomClass.ExternalLink> | List of external links to be embedded in the document. | Optional |
DocFileName | String | Name of the packaged document file (.doc or .docx). | Yes |
ProtectionLevel | String | Protection level of the document generated. | Yes |
AddWatermark | Boolean | Indicates whether to add a watermark to the document. | Yes |
RemoveWatermark | Boolean | Indicates whether to remove a watermark from the document. | Yes |
AddAutoHeaderFooter | Boolean | Indicates whether to use the configured header and footer format located in Comply System Properties.
| Yes |
HeaderText | String | Text to include in the document header. | Yes |
FooterText | String | Text to include in the document footer. | Yes |
PreserveRedlines | Boolean | Indicates whether the redlines in the input document will be preserved/ accepted in the packaged document. The default value is false. | Yes |
RetainInputHeaderFooter | Boolean | Indicates whether the merged document retains the existing header and footer of the original documents and page numbers are cumulative. | Optional |
CumulativePageNumber | Boolean | Indicates whether the merged document page numbers are cumulative. | Optional |
Response Parameter | ||
---|---|---|
Name | Type | Description |
docId | ID | The id of the generated PDF document. |
Code Sample
List<Apttus.CustomClass.AttachmentInfo> attachmentList = new List<Apttus.CustomClass.AttachmentInfo>();
Apttus.CustomClass.AttachmentInfo attch1 = new Apttus.CustomClass.AttachmentInfo();
attch1.RecordId='06975000001gIUgAAM';
attch1.Title='Test template.docx';
attch1.DocType='application/vnd.openxmlformats-officedocument.wordprocessingml.document';
Apttus.CustomClass.AttachmentInfo attch2 = new Apttus.CustomClass.AttachmentInfo();
attch2.RecordId='06975000001gIUlAAM';
attch2.Title='Testing email templates.docx';
attch2.DocType='application/vnd.openxmlformats-officedocument.wordprocessingml.document';
attachmentList.add(attch1);
attachmentList.add(attch2);
Apttus.CustomClass.ActionParams params = new Apttus.CustomClass.ActionParams();
params.SessionId = UserInfo.getSessionId();
params.SessionUrl='https://testmanaged--clmauto3.sandbox.my.salesforce.com/services/Soap/u/50.0/' + UserInfo.getOrganizationId();
params.SObjectId = 'a0775000006253lAAA';//AgreementId
params.ParentId = 'a0775000006253lAAA';//AgreementId
params.Attachments = attachmentList;
params.ProtectionLevel='Full Access';
params.DocFileName='all file merged.docx';
params.AddWatermark=true;
params.RemoveWatermark=false;
params.AddAutoHeaderFooter=false;
params.HeaderText='Apttus';
params.FooterText='2024 Copyright';
params.PreserveRedlines=true;
params.RetainInputHeaderFooter=false;
params.CumulativePageNumber=false;
ID response = Apttus.MergeWebService.mergeDocuments(params);
CODE
Integration Details
Use the following information in your integrations with Apttus Contract Management Web Services API. For information on how to get started, refer to Integrating Conga CLM with External Systems.
API Prerequisites
None.
Request/Response XML
Example Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mer="http://soap.sforce.com/schemas/class/Apttus/MergeWebService" xmlns:cus="http://soap.sforce.com/schemas/class/Apttus/CustomClass">
<soapenv:Header>
<mer:SessionHeader>
<mer:sessionId>00D0S0000000Pa8!ARUAQGAA1VTGcAG1zxylmAb1RJmiUnspuO5dzL53Xsx3jVhYI3oWTqB2dqzdBeswmwj_I49aI6BgIM4veO1At3rLd9z6BjXv</mer:sessionId>
</mer:SessionHeader>
</soapenv:Header>
<soapenv:Body>
<mer:mergeDocuments>
<mer:Params>
<cus:AddAutoHeaderFooter>False</cus:AddAutoHeaderFooter>
<cus:AddFooter>True</cus:AddFooter>
<cus:AddHeader>True</cus:AddHeader>
<cus:AddWatermark>True</cus:AddWatermark>
<cus:Attachments>
<cus:RecordId>0690S000000SxbRQAS</cus:RecordId>
<cus:Title>Test_DemoTemplate-KK_2020-07-17_1.0.0.doc</cus:Title>
</cus:Attachments>
<cus:Attachments>
<cus:RecordId>0690S000000SxYhQAK</cus:RecordId>
<cus:Title>Test_00AJ_Template with Clause_2020-07-17_1.0.0.doc</cus:Title>
</cus:Attachments>
<cus:DocFileName>Merged.PDF</cus:DocFileName>
<cus:DocIds>0690S000000SvnkQAC</cus:DocIds>
<cus:DocIds>0690S000000SvwIQAS</cus:DocIds>
<cus:FooterAlignment>Center</cus:FooterAlignment>
<cus:FooterFont>Tahoma</cus:FooterFont>
<cus:FooterFontSize>8</cus:FooterFontSize>
<cus:FooterMode>Overwrite</cus:FooterMode>
<cus:FooterText>Copyright 2020</cus:FooterText>
<cus:HeaderAlignment>Center</cus:HeaderAlignment>
<cus:HeaderFont>Tahoma</cus:HeaderFont>
<cus:HeaderFontSize>8</cus:HeaderFontSize>
<cus:HeaderMode>Overwrite</cus:HeaderMode>
<cus:HeaderText>Apttus</cus:HeaderText>
<cus:ParentId>a070S000002bSFzQAM</cus:ParentId>
<cus:PreserveRedlines>False</cus:PreserveRedlines>
<cus:ProtectionLevel>Full Access</cus:ProtectionLevel>
<cus:ProtectOutputDoc>True</cus:ProtectOutputDoc>
<cus:RemoveWatermark>False</cus:RemoveWatermark>
<cus:RetainInputHeaderFooter>False</cus:RetainInputHeaderFooter>
<cus:SessionId>00D0S0000000Pa8!ARUAQGAA1VTGcAG1zxylmAb1RJmiUnspuO5dzL53Xsx3jVhYI3oWTqB2dqzdBeswmwj_I49aI6BgIM4veO1At3rLd9z6BjXv</cus:SessionId>
<cus:SessionUrl>https://testmanagedclm--tbox.my.salesforce.com/services/Soap/u/50.0/00D0S0000000Pa8</cus:SessionUrl>
<cus:SObjectId>a070S000002bSFzQAM</cus:SObjectId>
</mer:Params>
</mer:mergeDocuments>
</soapenv:Body>
</soapenv:Envelope>
XML
Example Response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus/MergeWebService">
<soapenv:Body>
<mergeDocumentsResponse>
<result>0690S000000RvzCWRS</result>
</mergeDocumentsResponse>
</soapenv:Body>
</soapenv:Envelope>
XML