Use this API to package multiple proposal documents together into a singled merged PDF document. Implementation requires creation of a custom Visualforce page to make use of the API for document packaging purposes.

API

Signature

createPDFPackage

webService static Id createPDFPackage(Apttus_Proposal.CustomClass.ActionParams params) 

Parameters
NameTypeDescription
parentIdIDThe ID of the parent object associated with the result.
attachments

List<Apttus.CustomClass.AttachmentInfo>

List of all documents in the order to be packaged.
externalLinks

List<Apttus.CustomClass.ExternalLink>

List of external links to be embedded in document.
docFileNameStringName of the packaged document file (PDF).
sessionIdIDThe Session ID to use for callback.
sessionURLStringThe Server URL to use for callback.


 

Response
NameTypeDescription
resultIDReturns the ID of the merged PDF document.


 

Code Sample

  // Attachments
        //
        List<Apttus_Proposal.CustomClass.AttachmentInfo> attachmentsInfoList = new List<Apttus_Proposal.CustomClass.AttachmentInfo>();
		// Attachment: Primary
        Apttus_Proposal.CustomClass.AttachmentInfo attachmentInfo = new Apttus_Proposal.CustomClass.AttachmentInfo();                    
        ...
        ...
        attachmentInfo.Title            = attachmentDetails.Name;
        attachmentInfo.RecordId         = attachmentDetails.Id;
        attachmentsInfoList.add(attachmentInfo);

        // Attachments: Docx
        for (selectoption so : listOfDocxAttachmentsRelated2Proposal_Selected) {
                  
            Apttus_Proposal.CustomClass.AttachmentInfo attachmentInfo = new Apttus_Proposal.CustomClass.AttachmentInfo();
            ...
            ...                    
            attachmentInfo.Title            = attachmentDetails.Name;
            attachmentInfo.RecordId         = attachmentDetails.Id;
            attachmentsInfoList.add(attachmentInfo);
                    
        }
        // Attachments: PDFs
        for (selectoption so : listOfPDFAttachmentsRelated2Proposal_Selected) {
                  
            Apttus_Proposal.CustomClass.AttachmentInfo attachmentInfo = new Apttus_Proposal.CustomClass.AttachmentInfo();
            ...
            ...                    
            attachmentInfo.Title            = attachmentDetails.Name;
            attachmentInfo.RecordId         = attachmentDetails.Id;
            attachmentsInfoList.add(attachmentInfo);
                    
        }
        //
        // External Links
        //
        List<Apttus_Proposal.CustomClass.ExternalLink> externalLinksInfoList = new List<Apttus_Proposal.CustomClass.ExternalLink>();
        if ( !string.isBlank(externalLinks) ) {
            
            String[] arrayOfURLs = parseURLsCSV(externalLinks);
            
            for (String str : arrayOfURLs) {
                
                String url      = str.trim();
                String filename = getFilenameFromURL(url);
                
                Apttus_Proposal.CustomClass.ExternalLink externalLinkInfo = new Apttus_Proposal.CustomClass.ExternalLink();
                externalLinkInfo.Title  = filename;
                externalLinkInfo.Url    = url;
                externalLinksInfoList.add(externalLinkInfo);
            }
		}            
        // API Parameters
        Apttus_Proposal.CustomClass.ActionParams apiParameters  = new Apttus_Proposal.CustomClass.ActionParams();
        apiParameters.ParentId          = myProposal.Id;
        apiParameters.Attachments       = attachmentsInfoList;
        apiParameters.ExternalLinks     = externalLinksInfoList;
        apiParameters.DocFileName       = 'outputCollatedPDFFilename.pdf';
        apiParameters.SessionId         = sessionId;
        apiParameters.SessionUrl        = apiServerURL;
        try {
    
            //submit request
            Id myDocId = Apttus_Proposal.MergeWebService.createPDFPackage(apiParameters);
                        
        } catch (Exception ex) {
    
            System.debug('Apttus.MergeWebService.createPDFPackage: Oops!!! Caught an Exception: ' + ex);  
        }

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!ARUAQJ53E09loYXezDoz9WVOJugDkLwI58ibwr3Iefz8bY7_HNQ5j3jV302ejFtvD2n1wEI_VL_78sOCL76iVZ5ywpCZaAJs</mer:sessionId>
      </mer:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <mer:createPDF>
         <mer:params>
			<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>PDF_Package.PDF</cus:DocFileName>
            <cus:DocIds>0690S000000SvjOQAS</cus:DocIds>
            <cus:DocIds>0690S000000SvnkQAC</cus:DocIds>
            <cus:ParentId>a070S000002bSFzQAM</cus:ParentId>
            <cus:SessionId>00D0S0000000Pa8!ARUAQJ53E09loYXezDoz9WVOJugDkLwI58ibwr3Iefz8bY7_HNQ5j3jV302ejFtvD2n1wEI_VL_78sOCL76iVZ5ywpCZaAJs</cus:SessionId>
            <cus:SessionUrl>https://testmanagedclm--tbox.my.salesforce.com/services/Soap/u/50.0/00D0S0000000Pa8</cus:SessionUrl>
         </mer:params>
      </mer:createPDF>
   </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>
      <createPDFResponse>
         <result>0690S000000T0XIQA0</result>
      </createPDFResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML