This API converts an agreement Word document, specified in docFileName into a specific output format using the parameters, such as agreementId and docFormat. This API internally checks if the header and footer are added to the generated document.

Note

  • If the output document format is DOC or DOCX, the Id returned is that of the updated input document.
  • If the output document format is PDF, the Id returned is that of the newly created document.

API

Signature

convertWordDocForAgreement

webService static Id convertWordDocForAgreement(Id agreementId, Id docId, String docFileName, String docFormat, String pLevel, Boolean addWatermark, Boolean removeWatermark, String sessionId, String serverUrl)
Request Parameters
NameTypeDescriptionRequired?
agreementIdIDThe id of the agreement providing the content of the document.Yes
docIdIDThe id of the agreement document to convert in a different output format.Yes
docFileNameStringThe file name for the Word document.Yes
docFormatStringIndicates whether the document will be:
  • DOC
  • DOCX
  • RTF
  • PDF
Yes
pLevelStringThe protection level to apply to the document. Valid values are:
  • Full access
  • Insert comments only
  • Insert comments and tracked changes only
  • Read only
  • Fill in form fields only
Yes
addWatermarkBooleanIndicates whether a draft watermark should be added to the output document.Yes
removeWatermarkBooleanIndicates whether a draft watermark on the source word document should be removed from the resulting document.Yes
sessionIdStringThe Salesforce session id.Yes
serverUrlStringThe Salesforce server URL.Yes
Response Parameter
NameTypeDescription
docIdIDThe id of the converted document.

Code Sample

String apiServerURL = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/50.0/' + UserInfo.getOrganizationId();
ID attachmentID = 'a036F00000urlTX';
Id agreementId = 'a016F00001V5HZA';
String pLevel = 'Read only';
String docFormat = 'PDF';
Boolean addWatermark = true;
Boolean removeWatermark = true;
ID docId = Apttus.MergeWebService.convertWordDocForAgreement(agreementId,attachmentID,null,docFormat,pLevel,addWatermark,removeWatermark,ServerInfo.getSessionId(),apiServerURL);
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">
    <soapenv:Header>
        <mer:SessionHeader>
            <mer:sessionId>00D020000008lUh!AQYAQBDMUfqKvlqcVtqEnsqWZ3CvH_9PAn553rGgepU1CKttbRUAm4C8FFgTHrzkd6juez5FF4NEryvZ8ibJC__d7TM.vxCY</mer:sessionId>
        </mer:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
        <mer:convertAgreementWordDoc>
            <mer:agreementId>a07R000000AwP93IAF</mer:agreementId>
            <mer:docId>a20R00000025o1FIAQ</mer:docId>
            <mer:docFileName>MS-Original_TemplateWithOrgClause</mer:docFileName>
            <mer:docFormat>PDF</mer:docFormat>
            <mer:pLevel>Insert comments only</mer:pLevel>
            <mer:addWatermark>True</mer:addWatermark>
            <mer:removeWatermark>False</mer:removeWatermark>
            <mer:agreementNbr>00026745.0</mer:agreementNbr>
            <mer:dateFormat>YYYY-MM-DD</mer:dateFormat>
            <mer:sessionId>00D020000008lUh!AQYAQBDMUfqKvlqcVtqEnsqWZ3CvH_9PAn553rGgepU1CKttbRUAm4C8FFgTHrzkd6juez5FF4NEryvZ8ibJC__d7TM.vxCY</mer:sessionId>
            <mer:serverUrl>https://testmanaged--5s20minor.my.salesforce.com/services/Soap/u/50.0/00D020000008lUh</mer:serverUrl>
        </mer:convertAgreementWordDoc>
    </soapenv:Body>
</soapenv:Envelope>
XML

Example Response

<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <convertAgreementWordDoc>
            <result>a070S000002aDcuQAE</result>
        </convertAgreementWordDoc>
    </soapenv:Body>
</soapenv:Envelope>
XML