Newer Version Available
Document Templates (GET, PATCH, POST)
- Resource
-
1/connect/docgen/document-templates - GET Example
-
1https://yourInstance.salesforce.com/services/data/v66.0/connect/docgen/document-templates?offset=${offset}&limit=${limit}&searchString=${searchString} - PATCH Example
-
1https://yourInstance.salesforce.com/services/data/v66.0/connect/docgen/document-templates?documentTemplateId=${documentTemplateId} - POST Example
-
1https://yourInstance.salesforce.com/services/data/v66.0/connect/docgen/document-templates?documentTemplateId=${documentTemplateId}&action=${action} - Available version
- 60.0
- HTTP methods
- GET, PATCH, POST
- Request parameters for GET
-
Parameter Name Type Description Required or Optional Available Version cloneOnly String Filters the results to return only the document templates that can be cloned. Optional 66.0 limit String Number of document templates per page. The default value is 20. Optional 60.0 offset String Number of records to skip. The default value is 0. Optional 60.0 searchString String Search term that is used to retrieve a list of document templates. Optional 60.0 type String Filters the list of document templates by the file type. Optional 66.0 usageType String Filters the list of document templates by the usage type. Optional 66.0 - Response body for GET
- Document Template List
- Request body for PATCH
-
- JSON example
-
1{ 2 "isActive": "false", 3 "status": "Draft", 4 "documentGenerationMechanism": "ClientSide", 5 "extractOmniDataTransformName": "Extractor", 6 "mapperOmniDataTransformName": "Mapper", 7 "shouldDisplayUnmappedToken": "false", 8 "tokenList": "token1,token2,token3", 9 "tokenMappingMethodType": "ContextService", 10 "contextDefinitionName": "QuoteProposal", 11 "contextMappingName": "QuoteToContextMapping", 12 "customClassName": "QuoteBundleTransformer", 13 "contextFilterName": "QuoteWithLargeQtyLineItems", 14 "usageType": "Contract_Lifecycle_Management", 15 "contentDocumentId": "069xxxxxxxxxxxxxxx" 16} - Properties
-
Name Type Description Required or Optional Available Version contentDocumentId String ID of the document associated with a document template. Optional 60.0 contextDefinitionName String Name of the context definition that contains the mapping details used for extraction in the Context Service token mapping type. Required if the tokenMappingMethodTypeproperty is set to ContextService. 64.0 contextMappingName String Name of the context mapping used for extraction in the Context Service token mapping type. Required if the tokenMappingMethodTypeproperty is set to ContextService. 64.0 contextFilterName String Name of the context filter that’s used to filter, order, or limit the data extracted from the context service at run time. This property is available only when tokenMappingMethodType property value is ContextService.
Optional 66.0 customClassName String Name of a custom Apex class that’s used to transform token data before document generation. This property is available only when tokenMappingMethodType property value is ContextService.
Optional 66.0 documentGenerationMechanism String Specifies the method for generating the document. Possible values are: - Client-side
- Server-side
Optional 60.0 extractOmniDataTransformName String Name of the OmniDataTransform bundle of the extract type. Optional 60.0 isActive Boolean Indicates whether the document template is set to active (true) or inactive (false). Optional 60.0 mapperOmniDataTransformName String Name of the OmniDataTransform bundle of the mapper type. Optional 60.0 shouldDisplayUnmappedToken Boolean Indicates whether the document template unmapped tokens be displayed (true) or not (false). Optional 60.0 status String Status to be set for the document template. Optional 60.0 tokenList String List of tokens present in the document template. Optional 60.0 tokenMappingMethodType String Processing method for data that can originate from the same source object. Possible values are: - ContextService
- OmniDataTransform
Required 60.0 usageType String Usage type of the document template. Optional 60.0
- Request parameters for PATCH
-
Parameter Name Type Description Required or Optional Available Version documentTemplateId String ID of the document template for operations like cloning or creating a new version. Required 60.0 documentTemplateUpdateInput Object Specifies the details to modify an existing document template. Optional 64.0 - Response body for PATCH
- Document Template
- Request body for POST
-
- JSON example
-
1{ 2 "name": "TemplateName", 3 "type": "MicrosoftWord/MicrosoftPowerpoint/Microsoft365Word", 4 "tokenMappingMethodType": "OmniDataTransform", 5 "tokenMappingType": "JSON", 6 "extractOmniDataTransformName": "ExtractName", 7 "mapperOmniDataTransformName": "MapperName", 8 "contentDocumentId": "069xx0000004CyeAAE", 9 "documentGenerationMechanism": "ServerSide", 10 "usageType": "Contract_Lifecycle_Management", 11 "tokenList": "token1,token2,token3" 12} - This example shows a sample request with ContextService as the value of the tokenMappingMethodType
property.
1{ 2 "name": "TemplateName", 3 "type": "MicrosoftWord/MicrosoftPowerpoint/Microsoft365Word", 4 "tokenMappingMethodType": "ContextService", 5 "contextDefinitionName": "QuoteProposal", 6 "contextMappingName": "QuoteToContextMapping", 7 "customClassName": "QuoteBundleTransformer", 8 "contextFilterName": "QuoteWithLargeQtyLineItems", 9 "tokenMappingType": "JSON", 10 "extractOmniDataTransformName": "ExtractName", 11 "mapperOmniDataTransformName": "MapperName", 12 "contentDocumentId": "069xx0000004CyeAAE", 13 "documentGenerationMechanism": "ClientSide", 14 "usageType": "Contract_Lifecycle_Management", 15 "tokenList": "token1,token2,token3" 16} - Properties
-
Name Type Description Required or Optional Available Version contentDocumentId String ID of the Document associated with a document template. Optional 60.0 contextDefinitionName String Name of the context definition that contains the mapping details used for extraction in the Context Service token mapping type. Required if the tokenMappingMethodTypeproperty is set to ContextService. 64.0 contextMappingName String Name of the context mapping used for extraction in the Context Service token mapping type. Required if the tokenMappingMethodTypeproperty is set to ContextService. 64.0 contextFilterName String Name of the context filter that’s used to filter, order, or limit the data extracted from the context service at run time. This property is available only when the tokenMappingMethodType property value is ContextService.
Optional 66.0 customClassName String Name of a custom Apex class that’s used to transform token data before document generation. This property is available only when the tokenMappingMethodType property value is ContextService.
Optional 66.0 documentGenerationMechanism String Specifies the method for generating the document. Possible values are: - Client-side
- Server-side
Optional 60.0 extractOmniDataTransformName String Name of the OmniDataTransform bundle of the extract type. Optional 60.0 mapperOmniDataTransformName String Name of the OmniDataTransform bundle of the mapper type. Optional 60.0 name String Name of the document template. Required 60.0 tokenList String List of tokens present in the document template. Optional 60.0 tokenMappingMethodType String Processing method for the data that can originate from same source object. Possible values are: - ContextService
- OmniDataTransform
Required 60.0 tokenMappingType String Mapping type for tokens of the document template. Required 60.0 type String Type of document template. Required 60.0 usageType String Usage type of the document template. Optional 60.0
- Request parameters for POST
-
Parameter Name Type Description Required or Optional Available Version action String Action to be performed on the document template. Possible values are: - Clone
- NewVersion
Optional 60.0 documentTemplate Object Specifies the details of a new document template resource. Optional 64.0 documentTemplateId String ID of the document template for operations like cloning or creating a new version. Optional 60.0 - Response body for POST
- Document Template