Conga Product Documentation

Welcome to the new doc site. Some of your old bookmarks will no longer work. Please use the search bar to find your desired topic.

Show Page Sections

download

Converting a Word Document into a given output format

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

Name

Type

Description

Required?

agreementId

ID

The id of the agreement providing the content of the document.

Yes

docId

ID

The id of the agreement document to convert in a different output format.

Yes

docFileName

String

The file name for the Word document.

Yes

docFormat

String

Indicates whether the document will be:
  • DOC
  • DOCX
  • RTF
  • PDF

Yes

pLevel

String

The 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

addWatermark

Boolean

Indicates whether a draft watermark should be added to the output document.

Yes

removeWatermark

Boolean

Indicates whether a draft watermark on the source word document should be removed from the resulting document.

Yes

sessionId

String

The Salesforce session id.

Yes

serverUrl

String

The Salesforce server URL.

Yes

Response Parameter

Name

Type

Description

docId

ID

The 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);

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>

Example Response

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