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

Generates a Word agreement document by using the template specified by the templateId parameter and the agreement indicated by the agreementId. The document is added to the Files and Attachments section for the Agreement object.

The document can subsequently be converted to a PDF, using convertWordDocToPDF.

API

Signature

generateDoc

webService static Id generateDoc(Id templateId, Id agreementId, String pLevel, String docFormat, String sessionId, String serverUrl)

Request Parameters

Name

Type

Description

Required?

templateId

ID

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

Yes

agreementId

ID

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

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

sessionId

String

The Salesforce session id.

Yes

serverUrl

String

The Salesforce server id.

Yes

Response Parameter

Name

Type

Description

generatedDocId

ID

The id of the generated document.

Code Sample

ID templateId= 'a036F00000urlTX'; Id agreementId = 'a016F00001V5HZA'; String pLevel = 'Read only'; String docFormat = 'DOC'; String apiServerURL = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/50.0/' + UserInfo.getOrganizationId(); String SessionId = UserInfo.getSessionId(); //This is the session Id. String generatedDocId = Apttus.MergeWebService.generateDoc(templateId, agreementId, pLevel, docFormat, SessionId, apiServerURL);

This API is the same as the generateDoc API and additionally enables you to add a draft watermark to the generated document.

API

Signature

generateDoc2

webService static Id generateDoc2(Id templateId, Id agreementId, 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

agreementId

ID

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

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

generatedDocId

ID

The id of the generated document.

Code Sample

ID templateId= 'a036F00000urlTX'; Id agreementId = 'a016F00001V5K6C'; String pLevel = 'Read only'; String docFormat = 'DOC'; Boolean isDraft = true; String apiServerURL = System.Url.getSalesforceBaseUrl().toExternalForm() + '/services/Soap/u/50.0/' + UserInfo.getOrganizationId(); String SessionId = UserInfo.getSessionId(); //This is the session Id. String generatedDocId = Apttus.MergeWebService.generateDoc2(templateId, agreementId, pLevel, docFormat, isDraft, SessionId, 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

<?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:generateDoc> <mer:templateId>a09R000000AjMCy</mer:templateId> <mer:agreementId>a07020000008w91</mer:agreementId> <mer:pLevel>Full Access</mer:pLevel> <mer:docFormat>DOCX</mer:docFormat> <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:generateDoc> </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> <generateDocResponse> <result>00P02000000IazXEAS</result> </generateDocResponse> </soapenv:Body> </soapenv:Envelope>