This API generates a Word agreement document for a standard object, using the template selected by the templateId parameter and the object indicated by sObjectId and sObjectType.




webService static Id generateCustomDoc(Id templateId, Id sObjectId, String sObjectType, String pLevel, String docFormat, Boolean isDraft, String sessionId, String serverUrl)
Request Parameters
templateIdIDThe id of the template used to generate the word doc.Yes
sObjectIdIDThe id of the sObject holding the data for the merge fields.Yes
sObjectTypeStringThe type of the sObject.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
docFormatStringIndicates whether the document will be:
  • DOC
  • DOCX
  • PDF
  • RTF
isDraftBooleanIndicates whether a draft watermark should be added to the document.Yes
sessionIdStringThe Salesforce session id.Yes
serverUrlStringThe Salesforce server id.Yes
Response Parameter
docIDIDThe id of the generated document.

Code Sample

ID templateId = 'a036100000Fha5D';
ID sObjectId = '0016100000KvBHi';
String sObjectType = 'Account';
String pLevel = 'Full access';
String docFormat = 'DOCX';
Boolean isDraft = true;
String sessionId = UserInfo.getSessionId(); 
String serverUrl = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/50.0/' + UserInfo.getOrganizationId();
ID docId =  Apttus.MergeWebService.generateCustomDoc(templateId,sObjectId,sObjectType,pLevel,docFormat,isDraft,sessionId,serverUrl);

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


Request/Response XML

Example Request

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns:mer="">
         <mer:pLevel>Read only</mer:pLevel>

Example Response

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="" xmlns="">