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

Generating a Document for a Standard Object

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.

API

Signature

generateCustomDoc

webService static Id generateCustomDoc(Id templateId, Id sObjectId, String sObjectType, String pLevel, String docFormat, Boolean isDraft, String sessionId, String serverUrl)

Request Parameters

Name

Type

Description

Required?

templateId

ID

The id of the template used to generate the word doc.

Yes

sObjectId

ID

The id of the sObject holding the data for the merge fields.

Yes

sObjectType

String

The type of the sObject.

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

docFormat

String

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

Yes

isDraft

Boolean

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

Yes

sessionId

String

The Salesforce session id.

Yes

serverUrl

String

The Salesforce server id.

Yes

Response Parameter

Name

Type

Description

docID

ID

The 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

None.

Request/Response XML

Example Request

<?xml version="1.0" encoding="UTF-8"?> <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!AQYAQPYE.vw_Vh7FI.cV871nm9WWqIdhVINQJIl7PDNzr3fLVNdGjwk9qTJbDYIRoxbfpa44bpuIyeyVxEepPxdubr_AWjOv</mer:sessionId> </mer:SessionHeader> </soapenv:Header> <soapenv:Body> <mer:generateCustomDoc> <mer:templateId>a09R000000AjMCy</mer:templateId> <mer:sObjectId>0015500000YAdXR</mer:sObjectId> <mer:sObjectType>Account</mer:sObjectType> <mer:pLevel>Read only</mer:pLevel> <mer:docFormat>PDF</mer:docFormat> <mer:isDraft>True</mer:isDraft> <mer:sessionId>00D020000008lUh!AQYAQPYE.vw_Vh7FI.cV871nm9WWqIdhVINQJIl7PDNzr3fLVNdGjwk9qTJbDYIRoxbfpa44bpuIyeyVxEepPxdubr_AWjOv</mer:sessionId> <mer:serverUrl>https://testmanaged--5s20minor.my.salesforce.com/services/Soap/u/50.0/00D020000008lUh</mer:serverUrl> </mer:generateCustomDoc> </soapenv:Body> </soapenv:Envelope>

Example Response

<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus/MergeWebService"> <soapenv:Body> <generateCustomDocResponse> <result>00P02000000IazhEAC</result> </generateCustomDocResponse> </soapenv:Body> </soapenv:Envelope>