com.docusign.esign.api.TemplatesApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docusign-esign-java Show documentation
Show all versions of docusign-esign-java Show documentation
The official DocuSign eSignature JAVA client is based on version 2 of the DocuSign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.
package com.docusign.esign.api;
import com.docusign.esign.client.ApiClient;
import com.docusign.esign.client.ApiException;
import com.docusign.esign.client.ApiResponse;
import com.docusign.esign.client.Configuration;
import com.docusign.esign.client.Pair;
import com.docusign.esign.model.*;
import jakarta.ws.rs.core.GenericType;
/** TemplatesApi class. */
public class TemplatesApi {
private ApiClient apiClient;
/** TemplatesApi. */
public TemplatesApi() {
this(Configuration.getDefaultApiClient());
}
/** TemplatesApi. */
public TemplatesApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* getApiClient Method.
*
* @return ApiClient
*/
public ApiClient getApiClient() {
return apiClient;
}
/** setApiClient Method. */
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Creates custom document fields in an existing template document.. Creates custom document
* fields in an existing template document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateCustomFields (optional)
* @return CustomFields
* @throws ApiException if fails to make API call
*/
public CustomFields createCustomFields(
String accountId, String templateId, TemplateCustomFields templateCustomFields)
throws ApiException {
ApiResponse localVarResponse =
createCustomFieldsWithHttpInfo(accountId, templateId, templateCustomFields);
return localVarResponse.getData();
}
/**
* Creates custom document fields in an existing template document. Creates custom document fields
* in an existing template document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateCustomFields (optional)
* @return CustomFields
* @throws ApiException if fails to make API call
*/
public ApiResponse createCustomFieldsWithHttpInfo(
String accountId, String templateId, TemplateCustomFields templateCustomFields)
throws ApiException {
Object localVarPostBody = templateCustomFields;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createCustomFields");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling createCustomFields");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
CustomFields localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Creates custom document fields in an existing template document.. Creates custom document
* fields in an existing template document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param documentFieldsInformation (optional)
* @return DocumentFieldsInformation
* @throws ApiException if fails to make API call
*/
public DocumentFieldsInformation createDocumentFields(
String accountId,
String templateId,
String documentId,
DocumentFieldsInformation documentFieldsInformation)
throws ApiException {
ApiResponse localVarResponse =
createDocumentFieldsWithHttpInfo(
accountId, templateId, documentId, documentFieldsInformation);
return localVarResponse.getData();
}
/**
* Creates custom document fields in an existing template document. Creates custom document fields
* in an existing template document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param documentFieldsInformation (optional)
* @return DocumentFieldsInformation
* @throws ApiException if fails to make API call
*/
public ApiResponse createDocumentFieldsWithHttpInfo(
String accountId,
String templateId,
String documentId,
DocumentFieldsInformation documentFieldsInformation)
throws ApiException {
Object localVarPostBody = documentFieldsInformation;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createDocumentFields");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling createDocumentFields");
}
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(
400, "Missing the required parameter 'documentId' when calling createDocumentFields");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()))
.replaceAll(
"\\{" + "documentId" + "\\}", apiClient.escapeString(documentId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
DocumentFieldsInformation localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Provides a URL to start an edit view of the Template UI. This method returns a URL for starting
* an edit view of a template that uses the DocuSign Template UI.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateViewRequest (optional)
* @return ViewUrl
* @throws ApiException if fails to make API call
*/
public ViewUrl createEditView(
String accountId, String templateId, TemplateViewRequest templateViewRequest)
throws ApiException {
ApiResponse localVarResponse =
createEditViewWithHttpInfo(accountId, templateId, templateViewRequest);
return localVarResponse.getData();
}
/**
* Provides a URL to start an edit view of the Template UI This method returns a URL for starting
* an edit view of a template that uses the DocuSign Template UI.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateViewRequest (optional)
* @return ViewUrl
* @throws ApiException if fails to make API call
*/
public ApiResponse createEditViewWithHttpInfo(
String accountId, String templateId, TemplateViewRequest templateViewRequest)
throws ApiException {
Object localVarPostBody = templateViewRequest;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createEditView");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling createEditView");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/views/edit"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
ViewUrl localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Lock a template.. Locks the specified template, and sets the time until the lock expires, to
* prevent other users or recipients from accessing and changing the template. ###### Note: Users
* must have envelope locking capability enabled to use this function (the userSetting property
* `canLockEnvelopes` must be set to **true** for the user).
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param lockRequest (optional)
* @return LockInformation
* @throws ApiException if fails to make API call
*/
public LockInformation createLock(String accountId, String templateId, LockRequest lockRequest)
throws ApiException {
ApiResponse localVarResponse =
createLockWithHttpInfo(accountId, templateId, lockRequest);
return localVarResponse.getData();
}
/**
* Lock a template. Locks the specified template, and sets the time until the lock expires, to
* prevent other users or recipients from accessing and changing the template. ###### Note: Users
* must have envelope locking capability enabled to use this function (the userSetting property
* `canLockEnvelopes` must be set to **true** for the user).
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param lockRequest (optional)
* @return LockInformation
* @throws ApiException if fails to make API call
*/
public ApiResponse createLockWithHttpInfo(
String accountId, String templateId, LockRequest lockRequest) throws ApiException {
Object localVarPostBody = lockRequest;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createLock");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling createLock");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/lock"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
LockInformation localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
///
/// Adds tabs for a recipient. Adds one or more recipients to a template.
///
/** CreateRecipientsOptions Class. */
public class CreateRecipientsOptions {
private String resendEnvelope = null;
/** setResendEnvelope method. */
public void setResendEnvelope(String resendEnvelope) {
this.resendEnvelope = resendEnvelope;
}
/**
* getResendEnvelope method.
*
* @return String
*/
public String getResendEnvelope() {
return this.resendEnvelope;
}
}
/**
* Adds tabs for a recipient.. Adds one or more recipients to a template.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateRecipients (optional)
* @return Recipients
*/
public Recipients createRecipients(
String accountId, String templateId, TemplateRecipients templateRecipients)
throws ApiException {
return createRecipients(accountId, templateId, templateRecipients, null);
}
/**
* Adds tabs for a recipient.. Adds one or more recipients to a template.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateRecipients (optional)
* @param options for modifying the method behavior.
* @return Recipients
* @throws ApiException if fails to make API call
*/
public Recipients createRecipients(
String accountId,
String templateId,
TemplateRecipients templateRecipients,
TemplatesApi.CreateRecipientsOptions options)
throws ApiException {
ApiResponse localVarResponse =
createRecipientsWithHttpInfo(accountId, templateId, templateRecipients, options);
return localVarResponse.getData();
}
/**
* Adds tabs for a recipient. Adds one or more recipients to a template.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateRecipients (optional)
* @param options for modifying the method behavior.
* @return Recipients
* @throws ApiException if fails to make API call
*/
public ApiResponse createRecipientsWithHttpInfo(
String accountId,
String templateId,
TemplateRecipients templateRecipients,
TemplatesApi.CreateRecipientsOptions options)
throws ApiException {
Object localVarPostBody = templateRecipients;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createRecipients");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling createRecipients");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/recipients"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
if (options != null) {
localVarQueryParams.addAll(
apiClient.parameterToPair("resend_envelope", options.resendEnvelope));
}
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
Recipients localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Adds tabs for a recipient.. Adds one or more tabs for a recipient.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param recipientId The ID of the recipient being accessed. (required)
* @param templateTabs (optional)
* @return Tabs
* @throws ApiException if fails to make API call
*/
public Tabs createTabs(
String accountId, String templateId, String recipientId, TemplateTabs templateTabs)
throws ApiException {
ApiResponse localVarResponse =
createTabsWithHttpInfo(accountId, templateId, recipientId, templateTabs);
return localVarResponse.getData();
}
/**
* Adds tabs for a recipient. Adds one or more tabs for a recipient.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param recipientId The ID of the recipient being accessed. (required)
* @param templateTabs (optional)
* @return Tabs
* @throws ApiException if fails to make API call
*/
public ApiResponse createTabsWithHttpInfo(
String accountId, String templateId, String recipientId, TemplateTabs templateTabs)
throws ApiException {
Object localVarPostBody = templateTabs;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createTabs");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling createTabs");
}
// verify the required parameter 'recipientId' is set
if (recipientId == null) {
throw new ApiException(
400, "Missing the required parameter 'recipientId' when calling createTabs");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/recipients/{recipientId}/tabs"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()))
.replaceAll(
"\\{" + "recipientId" + "\\}", apiClient.escapeString(recipientId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
Tabs localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Creates an envelope from a template.. Creates a template definition using a multipart request.
* ###Template Email Subject Merge Fields Call this endpoint to insert a recipient name and email
* address merge fields into the email subject line when creating or sending from a template. The
* merge fields, based on the recipient's role name, are added to the `emailSubject`
* property when the template is created or when the template is used to create an envelope. After
* a template sender adds the name and email information for the recipient and sends the envelope,
* the recipient information is automatically merged into the appropriate fields in the email
* subject line. Both the sender and the recipients will see the information in the email subject
* line for any emails associated with the template. This provides an easy way for senders to
* organize their envelope emails without having to open an envelope to check the recipient.
* ###### Note: If merging the recipient information into the subject line causes the subject line
* to exceed 100 characters, then any characters over the 100 character limit are not included in
* the subject line. For cases where the recipient name or email is expected to be long, you
* should consider placing the merge field at the start of the email subject. To add a
* recipient's name in the subject line add the following text in the `emailSubject`
* property when creating the template or when sending an envelope from a template:
* [[<roleName>_UserName]] Example: `\"emailSubject\":\"[[Signer
* 1_UserName]], Please sign this NDA\",` To add a recipient's email address in the
* subject line add the following text in the `emailSubject` property when creating the
* template or when sending an envelope from a template: [[<roleName>_Email]] Example:
* `\"emailSubject\":\"[[Signer 1_Email]], Please sign this NDA\",`
* In both cases the <roleName> is the recipient's contents of the `roleName`
* property in the template. For cases where another recipient (such as an Agent, Editor, or
* Intermediary recipient) is entering the name and email information for the recipient included
* in the email subject, then [[<roleName>_UserName]] or [[<roleName>_Email]] is shown
* in the email subject.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param envelopeTemplate (optional)
* @return TemplateSummary
* @throws ApiException if fails to make API call
*/
public TemplateSummary createTemplate(String accountId, EnvelopeTemplate envelopeTemplate)
throws ApiException {
ApiResponse localVarResponse =
createTemplateWithHttpInfo(accountId, envelopeTemplate);
return localVarResponse.getData();
}
/**
* Creates an envelope from a template. Creates a template definition using a multipart request.
* ###Template Email Subject Merge Fields Call this endpoint to insert a recipient name and email
* address merge fields into the email subject line when creating or sending from a template. The
* merge fields, based on the recipient's role name, are added to the `emailSubject`
* property when the template is created or when the template is used to create an envelope. After
* a template sender adds the name and email information for the recipient and sends the envelope,
* the recipient information is automatically merged into the appropriate fields in the email
* subject line. Both the sender and the recipients will see the information in the email subject
* line for any emails associated with the template. This provides an easy way for senders to
* organize their envelope emails without having to open an envelope to check the recipient.
* ###### Note: If merging the recipient information into the subject line causes the subject line
* to exceed 100 characters, then any characters over the 100 character limit are not included in
* the subject line. For cases where the recipient name or email is expected to be long, you
* should consider placing the merge field at the start of the email subject. To add a
* recipient's name in the subject line add the following text in the `emailSubject`
* property when creating the template or when sending an envelope from a template:
* [[<roleName>_UserName]] Example: `\"emailSubject\":\"[[Signer
* 1_UserName]], Please sign this NDA\",` To add a recipient's email address in the
* subject line add the following text in the `emailSubject` property when creating the
* template or when sending an envelope from a template: [[<roleName>_Email]] Example:
* `\"emailSubject\":\"[[Signer 1_Email]], Please sign this NDA\",`
* In both cases the <roleName> is the recipient's contents of the `roleName`
* property in the template. For cases where another recipient (such as an Agent, Editor, or
* Intermediary recipient) is entering the name and email information for the recipient included
* in the email subject, then [[<roleName>_UserName]] or [[<roleName>_Email]] is shown
* in the email subject.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param envelopeTemplate (optional)
* @return TemplateSummary
* @throws ApiException if fails to make API call
*/
public ApiResponse createTemplateWithHttpInfo(
String accountId, EnvelopeTemplate envelopeTemplate) throws ApiException {
Object localVarPostBody = envelopeTemplate;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling createTemplate");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
TemplateSummary localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Post Responsive HTML Preview for a document in a template.. Creates a preview of the
* [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML version of a specific
* template document. This method enables you to preview a PDF document conversion to responsive
* HTML across device types prior to sending. The request body is a
* `documentHtmlDefinition` object, which holds the responsive signing parameters that
* define how to generate the HTML version of the signing document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param documentHtmlDefinition (optional)
* @return DocumentHtmlDefinitions
* @throws ApiException if fails to make API call
*/
public DocumentHtmlDefinitions createTemplateDocumentResponsiveHtmlPreview(
String accountId,
String templateId,
String documentId,
DocumentHtmlDefinition documentHtmlDefinition)
throws ApiException {
ApiResponse localVarResponse =
createTemplateDocumentResponsiveHtmlPreviewWithHttpInfo(
accountId, templateId, documentId, documentHtmlDefinition);
return localVarResponse.getData();
}
/**
* Post Responsive HTML Preview for a document in a template. Creates a preview of the
* [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML version of a specific
* template document. This method enables you to preview a PDF document conversion to responsive
* HTML across device types prior to sending. The request body is a
* `documentHtmlDefinition` object, which holds the responsive signing parameters that
* define how to generate the HTML version of the signing document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param documentHtmlDefinition (optional)
* @return DocumentHtmlDefinitions
* @throws ApiException if fails to make API call
*/
public ApiResponse
createTemplateDocumentResponsiveHtmlPreviewWithHttpInfo(
String accountId,
String templateId,
String documentId,
DocumentHtmlDefinition documentHtmlDefinition)
throws ApiException {
Object localVarPostBody = documentHtmlDefinition;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400,
"Missing the required parameter 'accountId' when calling createTemplateDocumentResponsiveHtmlPreview");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400,
"Missing the required parameter 'templateId' when calling createTemplateDocumentResponsiveHtmlPreview");
}
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(
400,
"Missing the required parameter 'documentId' when calling createTemplateDocumentResponsiveHtmlPreview");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/responsive_html_preview"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()))
.replaceAll(
"\\{" + "documentId" + "\\}", apiClient.escapeString(documentId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
DocumentHtmlDefinitions localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Adds the tabs to a tempate. Adds tabs to the document specified by `documentId` in
* the template specified by `templateId`. In the request body, you only need to specify
* the tabs that your are adding. For example, to add a text [prefill
* tab](/docs/esign-rest-api/reference/templates/templatedocumenttabs/create/#definition__templatetabs_prefilltabs),
* your request body might look like this: ``` { \"prefillTabs\": {
* \"textTabs\": [ { \"value\": \"a prefill text tab\",
* \"pageNumber\": \"1\", \"documentId\": \"1\",
* \"xPosition\": 316, \"yPosition\": 97 } ] } } ```
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param templateTabs (optional)
* @return Tabs
* @throws ApiException if fails to make API call
*/
public Tabs createTemplateDocumentTabs(
String accountId, String templateId, String documentId, TemplateTabs templateTabs)
throws ApiException {
ApiResponse localVarResponse =
createTemplateDocumentTabsWithHttpInfo(accountId, templateId, documentId, templateTabs);
return localVarResponse.getData();
}
/**
* Adds the tabs to a tempate Adds tabs to the document specified by `documentId` in the
* template specified by `templateId`. In the request body, you only need to specify the
* tabs that your are adding. For example, to add a text [prefill
* tab](/docs/esign-rest-api/reference/templates/templatedocumenttabs/create/#definition__templatetabs_prefilltabs),
* your request body might look like this: ``` { \"prefillTabs\": {
* \"textTabs\": [ { \"value\": \"a prefill text tab\",
* \"pageNumber\": \"1\", \"documentId\": \"1\",
* \"xPosition\": 316, \"yPosition\": 97 } ] } } ```
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param templateTabs (optional)
* @return Tabs
* @throws ApiException if fails to make API call
*/
public ApiResponse createTemplateDocumentTabsWithHttpInfo(
String accountId, String templateId, String documentId, TemplateTabs templateTabs)
throws ApiException {
Object localVarPostBody = templateTabs;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400,
"Missing the required parameter 'accountId' when calling createTemplateDocumentTabs");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400,
"Missing the required parameter 'templateId' when calling createTemplateDocumentTabs");
}
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(
400,
"Missing the required parameter 'documentId' when calling createTemplateDocumentTabs");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/tabs"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()))
.replaceAll(
"\\{" + "documentId" + "\\}", apiClient.escapeString(documentId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
Tabs localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Provides a URL to start a recipient view of the Envelope UI. This method returns a URL for a
* template recipient preview in the DocuSign UI that you can embed in your application. You use
* this method to enable the sender to preview the recipients' experience. For more
* information, see [Preview and
* Send](https://support.docusign.com/en/guides/ndse-user-guide-send-your-documents).
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param recipientPreviewRequest (optional)
* @return ViewUrl
* @throws ApiException if fails to make API call
*/
public ViewUrl createTemplateRecipientPreview(
String accountId, String templateId, RecipientPreviewRequest recipientPreviewRequest)
throws ApiException {
ApiResponse localVarResponse =
createTemplateRecipientPreviewWithHttpInfo(accountId, templateId, recipientPreviewRequest);
return localVarResponse.getData();
}
/**
* Provides a URL to start a recipient view of the Envelope UI This method returns a URL for a
* template recipient preview in the DocuSign UI that you can embed in your application. You use
* this method to enable the sender to preview the recipients' experience. For more
* information, see [Preview and
* Send](https://support.docusign.com/en/guides/ndse-user-guide-send-your-documents).
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param recipientPreviewRequest (optional)
* @return ViewUrl
* @throws ApiException if fails to make API call
*/
public ApiResponse createTemplateRecipientPreviewWithHttpInfo(
String accountId, String templateId, RecipientPreviewRequest recipientPreviewRequest)
throws ApiException {
Object localVarPostBody = recipientPreviewRequest;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400,
"Missing the required parameter 'accountId' when calling createTemplateRecipientPreview");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400,
"Missing the required parameter 'templateId' when calling createTemplateRecipientPreview");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/views/recipient_preview"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
ViewUrl localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Get Responsive HTML Preview for all documents in a template.. Creates a preview of the
* [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML versions of all of the
* documents associated with a template. This method enables you to preview the PDF document
* conversions to responsive HTML across device types prior to sending. The request body is a
* `documentHtmlDefinition` object, which holds the responsive signing parameters that
* define how to generate the HTML version of the documents.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentHtmlDefinition (optional)
* @return DocumentHtmlDefinitions
* @throws ApiException if fails to make API call
*/
public DocumentHtmlDefinitions createTemplateResponsiveHtmlPreview(
String accountId, String templateId, DocumentHtmlDefinition documentHtmlDefinition)
throws ApiException {
ApiResponse localVarResponse =
createTemplateResponsiveHtmlPreviewWithHttpInfo(
accountId, templateId, documentHtmlDefinition);
return localVarResponse.getData();
}
/**
* Get Responsive HTML Preview for all documents in a template. Creates a preview of the
* [responsive](/docs/esign-rest-api/esign101/concepts/responsive/), HTML versions of all of the
* documents associated with a template. This method enables you to preview the PDF document
* conversions to responsive HTML across device types prior to sending. The request body is a
* `documentHtmlDefinition` object, which holds the responsive signing parameters that
* define how to generate the HTML version of the documents.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentHtmlDefinition (optional)
* @return DocumentHtmlDefinitions
* @throws ApiException if fails to make API call
*/
public ApiResponse createTemplateResponsiveHtmlPreviewWithHttpInfo(
String accountId, String templateId, DocumentHtmlDefinition documentHtmlDefinition)
throws ApiException {
Object localVarPostBody = documentHtmlDefinition;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400,
"Missing the required parameter 'accountId' when calling createTemplateResponsiveHtmlPreview");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400,
"Missing the required parameter 'templateId' when calling createTemplateResponsiveHtmlPreview");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/responsive_html_preview"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
DocumentHtmlDefinitions localVarResponse =
apiClient.invokeAPI(
localVarPath,
"POST",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Deletes envelope custom fields in a template.. Deletes envelope custom fields in a template.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateCustomFields (optional)
* @return CustomFields
* @throws ApiException if fails to make API call
*/
public CustomFields deleteCustomFields(
String accountId, String templateId, TemplateCustomFields templateCustomFields)
throws ApiException {
ApiResponse localVarResponse =
deleteCustomFieldsWithHttpInfo(accountId, templateId, templateCustomFields);
return localVarResponse.getData();
}
/**
* Deletes envelope custom fields in a template. Deletes envelope custom fields in a template.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param templateCustomFields (optional)
* @return CustomFields
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteCustomFieldsWithHttpInfo(
String accountId, String templateId, TemplateCustomFields templateCustomFields)
throws ApiException {
Object localVarPostBody = templateCustomFields;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling deleteCustomFields");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling deleteCustomFields");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/custom_fields"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll(
"\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType = new GenericType() {};
CustomFields localVarResponse =
apiClient.invokeAPI(
localVarPath,
"DELETE",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Deletes custom document fields from an existing template document.. Deletes custom document
* fields from an existing template document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param documentFieldsInformation (optional)
* @return DocumentFieldsInformation
* @throws ApiException if fails to make API call
*/
public DocumentFieldsInformation deleteDocumentFields(
String accountId,
String templateId,
String documentId,
DocumentFieldsInformation documentFieldsInformation)
throws ApiException {
ApiResponse localVarResponse =
deleteDocumentFieldsWithHttpInfo(
accountId, templateId, documentId, documentFieldsInformation);
return localVarResponse.getData();
}
/**
* Deletes custom document fields from an existing template document. Deletes custom document
* fields from an existing template document.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param documentFieldsInformation (optional)
* @return DocumentFieldsInformation
* @throws ApiException if fails to make API call
*/
public ApiResponse deleteDocumentFieldsWithHttpInfo(
String accountId,
String templateId,
String documentId,
DocumentFieldsInformation documentFieldsInformation)
throws ApiException {
Object localVarPostBody = documentFieldsInformation;
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(
400, "Missing the required parameter 'accountId' when calling deleteDocumentFields");
}
// verify the required parameter 'templateId' is set
if (templateId == null) {
throw new ApiException(
400, "Missing the required parameter 'templateId' when calling deleteDocumentFields");
}
// verify the required parameter 'documentId' is set
if (documentId == null) {
throw new ApiException(
400, "Missing the required parameter 'documentId' when calling deleteDocumentFields");
}
// create path and map variables
String localVarPath =
"/v2.1/accounts/{accountId}/templates/{templateId}/documents/{documentId}/fields"
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "templateId" + "\\}", apiClient.escapeString(templateId.toString()))
.replaceAll(
"\\{" + "documentId" + "\\}", apiClient.escapeString(documentId.toString()));
// query params
java.util.List localVarQueryParams = new java.util.ArrayList();
java.util.List localVarCollectionQueryParams = new java.util.ArrayList();
java.util.Map localVarHeaderParams = new java.util.HashMap();
java.util.Map localVarFormParams = new java.util.HashMap();
final String[] localVarAccepts = {"application/json"};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] {"docusignAccessCode"};
GenericType localVarReturnType =
new GenericType() {};
DocumentFieldsInformation localVarResponse =
apiClient.invokeAPI(
localVarPath,
"DELETE",
localVarQueryParams,
localVarCollectionQueryParams,
localVarPostBody,
localVarHeaderParams,
localVarFormParams,
localVarAccept,
localVarContentType,
localVarAuthNames,
localVarReturnType);
return new ApiResponse(
apiClient.getStatusCode(), apiClient.getResponseHeaders(), localVarResponse);
}
/**
* Deletes a page from a document in an template.. Deletes a page from a document in a template
* based on the page number.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param pageNumber The page number being accessed. (required)
* @param pageRequest (optional)
* @throws ApiException if fails to make API call
*/
public void deleteDocumentPage(
String accountId,
String templateId,
String documentId,
String pageNumber,
PageRequest pageRequest)
throws ApiException {
deleteDocumentPageWithHttpInfo(accountId, templateId, documentId, pageNumber, pageRequest);
}
/**
* Deletes a page from a document in an template. Deletes a page from a document in a template
* based on the page number.
*
* @param accountId The external account number (int) or account ID Guid. (required)
* @param templateId The ID of the template being accessed. (required)
* @param documentId The ID of the document being accessed. (required)
* @param pageNumber The page number being accessed. (required)
* @param pageRequest (optional)
* @throws ApiException if fails to make API call
*/
public ApiResponse