This API allows you to merge multiple documents into a single document.


API

Signature

mergeDocuments

webService static Id mergeDocuments(Apttus.CustomClass.ActionParams params)
Request Parameters
NameTypeDescriptionRequired?
ParentIdIDThe ID of the parent object associated with the result.Yes
sObjectIdIDThe ID of the standard objectYes
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
DocFileNameStringName of the packaged document file (.doc or .docx).Yes
ProtectionLevelStringProtection level of the document generated.Yes
AddWatermarkBooleanIndicates whether to add a watermark to the document.Yes
RemoveWatermarkBooleanIndicates whether to remove a watermark from the document.Yes
AddAutoHeaderFooterBoolean

Indicates whether to use the configured header and footer format located in Comply System Properties.

  • If AddAutoHeaderFooter=true, the API uses the Comply System Properties defined for header and footer data.
  • If AddAutoHeaderFooter=false, the API uses values from the headerText and footerText parameters.
Yes
HeaderTextStringText to include in the document header.Yes
FooterTextStringText to include in the document footer.Yes
PreserveRedlinesBooleanIndicates whether the redlines in the input document will be preserved/ accepted in the packaged document. The default value is false.Yes
SessionIdIDThe Salesforce Session ID.Yes
SessionUrlStringThe Salesforce Server URL.Yes
RetainInputHeaderFooterBooleanIndicates whether the merged document retains the existing header and footer of the original documents and page numbers are cumulative.Optional
CumulativePageNumberBooleanIndicates whether the merged document page numbers are cumulative.Optional
Response Parameter
NameTypeDescription
docIdIDThe id of the generated PDF document.

Code Sample

{"SessionId":"00D0b000000DwSP!AQcAQOVWzYqVxU8jtOXxaQJe43sDdhLe4fsuRXsVri9ztEp8huD1u8ugJ3XI02CwbVssgtPdwmA4cQWuRnvJHJAFjWJZYZiX",
"SessionUrl":"https://yogi-dev2-dev-ed--c.na57.visual.force.com/services/Soap/u/42.0/00D0b000000DwSP",
"ParentId":"a010b00000k3f69AAA",
"sObjectId":"a010b00000k3f69AAA",
"Attachments":[{"RecordId":"0690b00000CBrXVAA1",
"Title":"test333.docx",
"docType":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
{"RecordId":"0690b00000CBrXBAA1",
"Title":"test345.docx",
"docType":"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}],
"ExternalLinks":[],
"DocFileName":"MergedDocument",
"AddWatermark":true,
"RemoveWatermark":false,
"AddAutoHeaderFooter":false,
"HeaderText":"Apttus",
"FooterText":"2020 Copyright",
"PreserveRedlines":true,
"RetainInputHeaderFooter":false,
"CumulativePageNumber":false}"
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 Apttus 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/49.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