=begin #DocuSign REST API #The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git =end require "uri" module DocuSign_eSign class ApplyTemplateOptions # attr_accessor :preserve_template_recipient def self.default @@default ||= ApplyTemplateOptions.new end end class ApplyTemplateToDocumentOptions # attr_accessor :preserve_template_recipient def self.default @@default ||= ApplyTemplateToDocumentOptions.new end end class CreateEnvelopeOptions # attr_accessor :cdse_mode # attr_accessor :change_routing_order # If set to true then we want to set the sourceEnvelopeId to indicate that this is a\"forward\" envelope action attr_accessor :completed_documents_only # When set to **true**, merges template roles and remove empty recipients when you create an envelope with multiple templates. attr_accessor :merge_roles_on_draft # attr_accessor :tab_label_exact_matches def self.default @@default ||= CreateEnvelopeOptions.new end end class CreateRecipientOptions # When set to **true**, resends the envelope if the new recipient's routing order is before or the same as the envelope's next recipient. attr_accessor :resend_envelope def self.default @@default ||= CreateRecipientOptions.new end end class GetChunkedUploadOptions # attr_accessor :include def self.default @@default ||= GetChunkedUploadOptions.new end end class GetCommentsTranscriptOptions # attr_accessor :encoding def self.default @@default ||= GetCommentsTranscriptOptions.new end end class GetConsumerDisclosureOptions # The simple type enumeration the language used in the response. The supported languages, with the language value shown in parenthesis, are:Arabic (ar), Armenian (hy), Armenian (hy), Bulgarian (bg), Czech (cs), Chinese Simplified (zh_CN), Chinese Traditional (zh_TW), Croatian (hr), Danish (da), Dutch (nl), English US (en), English UK (en_GB), Estonian (et), Farsi (fa), Finnish (fi), French (fr), French Canada (fr_CA), German (de), Greek (el), Hebrew (he), Hindi (hi), Hungarian (hu), Bahasa Indonesia (id), Italian (it), Japanese (ja), Korean (ko), Latvian (lv), Lithuanian (lt), Bahasa Melayu (ms), Norwegian (no), Polish (pl), Portuguese (pt), Portuguese Brazil (pt_BR), Romanian (ro), Russian (ru), Serbian (sr), Slovak (sk), Slovenian (sl), Spanish (es),Spanish Latin America (es_MX), Swedish (sv), Thai (th), Turkish (tr), Ukrainian (uk) and Vietnamese (vi). Additionally, the value can be set to �browser� to automatically detect the browser language being used by the viewer and display the disclosure in that language. attr_accessor :lang_code2 def self.default @@default ||= GetConsumerDisclosureOptions.new end end class GetConsumerDisclosureDefaultOptions # attr_accessor :lang_code def self.default @@default ||= GetConsumerDisclosureDefaultOptions.new end end class GetDocumentOptions # When set to **false**, the envelope signing certificate is removed from the download. attr_accessor :certificate # attr_accessor :documents_by_userid # attr_accessor :encoding # When set to **true**, the PDF bytes returned in the response are encrypted for all the key managers configured on your DocuSign account. The documents can be decrypted with the KeyManager Decrypt Document API. attr_accessor :encrypt # Specifies the language for the Certificate of Completion in the response. The supported languages, with the language value shown in parenthesis, are: Chinese Simplified (zh_CN), , Chinese Traditional (zh_TW), Dutch (nl), English US (en), French (fr), German (de), Italian (it), Japanese (ja), Korean (ko), Portuguese (pt), Portuguese (Brazil) (pt_BR), Russian (ru), Spanish (es). attr_accessor :language # attr_accessor :recipient_id # attr_accessor :shared_user_id # When set to **true**, any changed fields for the returned PDF are highlighted in yellow and optional signatures or initials outlined in red. attr_accessor :show_changes # When set to **true**, the account has the watermark feature enabled, and the envelope is not complete, the watermark for the account is added to the PDF documents. This option can remove the watermark. attr_accessor :watermark def self.default @@default ||= GetDocumentOptions.new end end class GetDocumentPageImageOptions # Sets the dpi for the image. attr_accessor :dpi # Sets the maximum height for the page image in pixels. The dpi is recalculated based on this setting. attr_accessor :max_height # Sets the maximum width for the page image in pixels. The dpi is recalculated based on this setting. attr_accessor :max_width # attr_accessor :show_changes def self.default @@default ||= GetDocumentPageImageOptions.new end end class GetDocumentTabsOptions # attr_accessor :include_metadata # attr_accessor :page_numbers def self.default @@default ||= GetDocumentTabsOptions.new end end class GetEnvelopeOptions # When true, envelope information can be added or modified. attr_accessor :advanced_update # attr_accessor :include def self.default @@default ||= GetEnvelopeOptions.new end end class GetEnvelopeTransferRulesOptions # attr_accessor :count # attr_accessor :start_position def self.default @@default ||= GetEnvelopeTransferRulesOptions.new end end class GetPagesOptions # attr_accessor :count # attr_accessor :dpi # attr_accessor :max_height # attr_accessor :max_width # attr_accessor :nocache # attr_accessor :show_changes # attr_accessor :start_position def self.default @@default ||= GetPagesOptions.new end end class GetRecipientInitialsImageOptions # The added line and identifier around the initial image. Note: Older envelopes might only have chromed images. If getting the non-chromed image fails, try getting the chromed image. attr_accessor :include_chrome def self.default @@default ||= GetRecipientInitialsImageOptions.new end end class GetRecipientSignatureImageOptions # When set to **true**, indicates the chromed version of the signature image should be retrieved. attr_accessor :include_chrome def self.default @@default ||= GetRecipientSignatureImageOptions.new end end class ListDocumentsOptions # attr_accessor :documents_by_userid # attr_accessor :include_docgen_formfields # attr_accessor :include_document_size # attr_accessor :include_metadata # attr_accessor :include_tabs # attr_accessor :recipient_id # attr_accessor :shared_user_id def self.default @@default ||= ListDocumentsOptions.new end end class ListRecipientsOptions # When set to **true** and `include_tabs` is set to **true**, all tabs with anchor tab properties are included in the response. attr_accessor :include_anchor_tab_locations # When set to **true**, the extended properties are included in the response. attr_accessor :include_extended # attr_accessor :include_metadata # When set to **true**, the tab information associated with the recipient is included in the response. attr_accessor :include_tabs def self.default @@default ||= ListRecipientsOptions.new end end class ListStatusOptions # attr_accessor :ac_status # attr_accessor :block # attr_accessor :count # attr_accessor :email # attr_accessor :envelope_ids # attr_accessor :from_date # attr_accessor :from_to_status # attr_accessor :start_position # attr_accessor :status # attr_accessor :to_date # attr_accessor :transaction_ids # attr_accessor :user_name def self.default @@default ||= ListStatusOptions.new end end class ListStatusChangesOptions # Specifies the Authoritative Copy Status for the envelopes. The possible values are: Unknown, Original, Transferred, AuthoritativeCopy, AuthoritativeCopyExportPending, AuthoritativeCopyExported, DepositPending, Deposited, DepositedEO, or DepositFailed. attr_accessor :ac_status # attr_accessor :block # attr_accessor :cdse_mode # attr_accessor :continuation_token # attr_accessor :count # This specifies the envelope custom field name and value searched for in the envelope information. The value portion of the query can use partial strings by adding '%' (percent sign) around the custom field query value. Example 1: If you have an envelope custom field called \"Region\" and you want to search for all envelopes where the value is \"West\" you would use the query: `?custom_field=Region=West`. Example 2: To search for envelopes where the `ApplicationID` custom field has the value or partial value of \"DocuSign\" in field, the query would be: `?custom_field=ApplicationId=%DocuSign%` This would find envelopes where the custom field value is \"DocuSign for Salesforce\" or \"DocuSign envelope.\" attr_accessor :custom_field # attr_accessor :email # attr_accessor :envelope_ids # attr_accessor :exclude # attr_accessor :folder_ids # attr_accessor :folder_types # The date/time setting that specifies the date/time when the request begins checking for status changes for envelopes in the account. This is required unless 'envelopeId's are used. attr_accessor :from_date # This is the status type checked for in the `from_date`/`to_date` period. If `changed` is specified, then envelopes that changed status during the period are found. If for example, `created` is specified, then envelopes created during the period are found. Default is `changed`. Possible values are: Voided, Changed, Created, Deleted, Sent, Delivered, Signed, Completed, Declined, TimedOut and Processing. attr_accessor :from_to_status # attr_accessor :include # attr_accessor :include_purge_information # attr_accessor :intersecting_folder_ids # attr_accessor :last_queried_date # attr_accessor :order # attr_accessor :order_by # attr_accessor :powerformids # attr_accessor :query_budget # attr_accessor :requester_date_format # attr_accessor :search_text # attr_accessor :start_position # The list of current statuses to include in the response. By default, all envelopes found are returned. If values are specified, then of the envelopes found, only those with the current status specified are returned in the results. Possible values are: Voided, Created, Deleted, Sent, Delivered, Signed, Completed, Declined, TimedOut and Processing. attr_accessor :status # Optional date/time setting that specifies the date/time when the request stops for status changes for envelopes in the account. If no entry, the system uses the time of the call as the `to_date`. attr_accessor :to_date # If included in the query string, this is a comma separated list of envelope `transactionId`s. If included in the `request_body`, this is a list of envelope `transactionId`s. ###### Note: `transactionId`s are only valid in the DocuSign system for seven days. attr_accessor :transaction_ids # attr_accessor :user_filter # attr_accessor :user_id # attr_accessor :user_name def self.default @@default ||= ListStatusChangesOptions.new end end class ListTabsOptions # When set to **true**, all tabs with anchor tab properties are included in the response. attr_accessor :include_anchor_tab_locations # attr_accessor :include_metadata def self.default @@default ||= ListTabsOptions.new end end class ListTemplatesOptions # The possible values are: matching_applied - This returns template matching information for the template. attr_accessor :include def self.default @@default ||= ListTemplatesOptions.new end end class ListTemplatesForDocumentOptions # attr_accessor :include def self.default @@default ||= ListTemplatesForDocumentOptions.new end end class UpdateOptions # When set to **true**, allows the caller to update recipients, tabs, custom fields, notification, email settings and other envelope attributes. attr_accessor :advanced_update # When set to **true**, sends the specified envelope again. attr_accessor :resend_envelope def self.default @@default ||= UpdateOptions.new end end class UpdateChunkedUploadOptions # attr_accessor :action def self.default @@default ||= UpdateChunkedUploadOptions.new end end class UpdateRecipientsOptions # attr_accessor :combine_same_order_recipients # attr_accessor :offline_signing # When set to **true**, resends the envelope if the new recipient's routing order is before or the same as the envelope's next recipient. attr_accessor :resend_envelope def self.default @@default ||= UpdateRecipientsOptions.new end end class EnvelopesApi attr_accessor :api_client def initialize(api_client = EnvelopesApi.default) @api_client = api_client end # Adds templates to an envelope. # Adds templates to the specified envelope. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_template_list (optional parameter) # @param DocuSign_eSign::ApplyTemplateOptions Options for modifying the behavior of the function. # @return [DocumentTemplateList] def apply_template(account_id, envelope_id, document_template_list, options = DocuSign_eSign::ApplyTemplateOptions.default) data, _status_code, _headers = apply_template_with_http_info(account_id, envelope_id, document_template_list, options) return data end # Adds templates to an envelope. # Adds templates to the specified envelope. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_template_list (optional parameter) # @param DocuSign_eSign::ApplyTemplateOptions Options for modifying the behavior of the function. # @return [Array<(DocumentTemplateList, Fixnum, Hash)>] DocumentTemplateList data, response status code and response headers def apply_template_with_http_info(account_id, envelope_id, document_template_list, options = DocuSign_eSign::ApplyTemplateOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.apply_template ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.apply_template" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.apply_template" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/templates".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} query_params[:'preserve_template_recipient'] = options.preserve_template_recipient if !options.preserve_template_recipient.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(document_template_list) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentTemplateList') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#apply_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds templates to a document in an envelope. # Adds templates to a document in the specified envelope. # @param account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_template_list (optional parameter) # @param DocuSign_eSign::ApplyTemplateToDocumentOptions Options for modifying the behavior of the function. # @return [DocumentTemplateList] def apply_template_to_document(account_id, document_id, envelope_id, document_template_list, options = DocuSign_eSign::ApplyTemplateToDocumentOptions.default) data, _status_code, _headers = apply_template_to_document_with_http_info(account_id, document_id, envelope_id, document_template_list, options) return data end # Adds templates to a document in an envelope. # Adds templates to a document in the specified envelope. # @param account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_template_list (optional parameter) # @param DocuSign_eSign::ApplyTemplateToDocumentOptions Options for modifying the behavior of the function. # @return [Array<(DocumentTemplateList, Fixnum, Hash)>] DocumentTemplateList data, response status code and response headers def apply_template_to_document_with_http_info(account_id, document_id, envelope_id, document_template_list, options = DocuSign_eSign::ApplyTemplateToDocumentOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.apply_template_to_document ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.apply_template_to_document" if account_id.nil? # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling EnvelopesApi.apply_template_to_document" if document_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.apply_template_to_document" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/templates".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} query_params[:'preserve_template_recipient'] = options.preserve_template_recipient if !options.preserve_template_recipient.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(document_template_list) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentTemplateList') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#apply_template_to_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Initiate a new ChunkedUpload. # This method initiates a new chunked upload with the first part of the content. # @param account_id The external account number (int) or account ID Guid. # @param chunked_upload_request (optional parameter) # @return [ChunkedUploadResponse] def create_chunked_upload(account_id, chunked_upload_request) data, _status_code, _headers = create_chunked_upload_with_http_info(account_id, chunked_upload_request) return data end # Initiate a new ChunkedUpload. # This method initiates a new chunked upload with the first part of the content. # @param account_id The external account number (int) or account ID Guid. # @param chunked_upload_request (optional parameter) # @return [Array<(ChunkedUploadResponse, Fixnum, Hash)>] ChunkedUploadResponse data, response status code and response headers def create_chunked_upload_with_http_info(account_id, chunked_upload_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_chunked_upload ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_chunked_upload" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/chunked_uploads".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(chunked_upload_request) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ChunkedUploadResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_chunked_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns a URL to the authentication view UI. # Returns a URL that allows you to embed the authentication view of the DocuSign UI in your applications. # @param account_id The external account number (int) or account ID Guid. # @param console_view_request (optional parameter) # @return [ViewUrl] def create_console_view(account_id, console_view_request) data, _status_code, _headers = create_console_view_with_http_info(account_id, console_view_request) return data end # Returns a URL to the authentication view UI. # Returns a URL that allows you to embed the authentication view of the DocuSign UI in your applications. # @param account_id The external account number (int) or account ID Guid. # @param console_view_request (optional parameter) # @return [Array<(ViewUrl, Fixnum, Hash)>] ViewUrl data, response status code and response headers def create_console_view_with_http_info(account_id, console_view_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_console_view ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_console_view" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/views/console".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(console_view_request) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ViewUrl') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_console_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns a URL to the envelope correction UI. # Returns a URL that allows you to embed the envelope correction view of the DocuSign UI in your applications. Important: iFrames should not be used for embedded operations on mobile devices due to screen space issues. For iOS devices DocuSign recommends using a WebView. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param correct_view_request (optional parameter) # @return [ViewUrl] def create_correct_view(account_id, envelope_id, correct_view_request) data, _status_code, _headers = create_correct_view_with_http_info(account_id, envelope_id, correct_view_request) return data end # Returns a URL to the envelope correction UI. # Returns a URL that allows you to embed the envelope correction view of the DocuSign UI in your applications. Important: iFrames should not be used for embedded operations on mobile devices due to screen space issues. For iOS devices DocuSign recommends using a WebView. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param correct_view_request (optional parameter) # @return [Array<(ViewUrl, Fixnum, Hash)>] ViewUrl data, response status code and response headers def create_correct_view_with_http_info(account_id, envelope_id, correct_view_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_correct_view ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_correct_view" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_correct_view" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/correct".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(correct_view_request) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ViewUrl') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_correct_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates envelope custom fields for an envelope. # Updates the envelope custom fields for draft and in-process envelopes. Each custom field used in an envelope must have a unique name. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param custom_fields (optional parameter) # @return [CustomFields] def create_custom_fields(account_id, envelope_id, custom_fields) data, _status_code, _headers = create_custom_fields_with_http_info(account_id, envelope_id, custom_fields) return data end # Updates envelope custom fields for an envelope. # Updates the envelope custom fields for draft and in-process envelopes. Each custom field used in an envelope must have a unique name. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param custom_fields (optional parameter) # @return [Array<(CustomFields, Fixnum, Hash)>] CustomFields data, response status code and response headers def create_custom_fields_with_http_info(account_id, envelope_id, custom_fields) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_custom_fields ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_custom_fields" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_custom_fields" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/custom_fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(custom_fields) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CustomFields') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_custom_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates custom document fields in an existing envelope document. # Creates custom document fields in an existing envelope document. # @param account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_fields_information (optional parameter) # @return [DocumentFieldsInformation] def create_document_fields(account_id, document_id, envelope_id, document_fields_information) data, _status_code, _headers = create_document_fields_with_http_info(account_id, document_id, envelope_id, document_fields_information) return data end # Creates custom document fields in an existing envelope document. # Creates custom document fields in an existing envelope document. # @param account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_fields_information (optional parameter) # @return [Array<(DocumentFieldsInformation, Fixnum, Hash)>] DocumentFieldsInformation data, response status code and response headers def create_document_fields_with_http_info(account_id, document_id, envelope_id, document_fields_information) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_document_fields ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_document_fields" if account_id.nil? # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling EnvelopesApi.create_document_fields" if document_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_document_fields" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/fields".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(document_fields_information) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentFieldsInformation') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_document_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Responsive HTML Preview for a document in an envelope. # Creates a preview of the [responsive](/docs/esign-rest-api/esign101/concepts/responsive/) HTML version of a specific 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 account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_html_definition (optional parameter) # @return [DocumentHtmlDefinitions] def create_document_responsive_html_preview(account_id, document_id, envelope_id, document_html_definition) data, _status_code, _headers = create_document_responsive_html_preview_with_http_info(account_id, document_id, envelope_id, document_html_definition) return data end # Get Responsive HTML Preview for a document in an envelope. # Creates a preview of the [responsive](/docs/esign-rest-api/esign101/concepts/responsive/) HTML version of a specific 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 account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param document_html_definition (optional parameter) # @return [Array<(DocumentHtmlDefinitions, Fixnum, Hash)>] DocumentHtmlDefinitions data, response status code and response headers def create_document_responsive_html_preview_with_http_info(account_id, document_id, envelope_id, document_html_definition) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_document_responsive_html_preview ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_document_responsive_html_preview" if account_id.nil? # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling EnvelopesApi.create_document_responsive_html_preview" if document_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_document_responsive_html_preview" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/responsive_html_preview".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(document_html_definition) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DocumentHtmlDefinitions') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_document_responsive_html_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds the tabs to an envelope document # Adds tabs to the document specified by `documentId` in the envelope specified by `envelopeId`. 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/envelopes/envelopedocumenttabs/create/#definition__tabs_prefilltabs), your request body might look like this: ``` { \"prefillTabs\": { \"textTabs\": [ { \"value\": \"a prefill text tab\", \"pageNumber\": \"1\", \"documentId\": \"1\", \"xPosition\": 316, \"yPosition\": 97 } ] } } ``` # @param account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param tabs (optional parameter) # @return [Tabs] def create_document_tabs(account_id, document_id, envelope_id, tabs) data, _status_code, _headers = create_document_tabs_with_http_info(account_id, document_id, envelope_id, tabs) return data end # Adds the tabs to an envelope document # Adds tabs to the document specified by `documentId` in the envelope specified by `envelopeId`. 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/envelopes/envelopedocumenttabs/create/#definition__tabs_prefilltabs), your request body might look like this: ``` { \"prefillTabs\": { \"textTabs\": [ { \"value\": \"a prefill text tab\", \"pageNumber\": \"1\", \"documentId\": \"1\", \"xPosition\": 316, \"yPosition\": 97 } ] } } ``` # @param account_id The external account number (int) or account ID Guid. # @param document_id The ID of the document being accessed. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param tabs (optional parameter) # @return [Array<(Tabs, Fixnum, Hash)>] Tabs data, response status code and response headers def create_document_tabs_with_http_info(account_id, document_id, envelope_id, tabs) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_document_tabs ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_document_tabs" if account_id.nil? # verify the required parameter 'document_id' is set fail ArgumentError, "Missing the required parameter 'document_id' when calling EnvelopesApi.create_document_tabs" if document_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_document_tabs" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/tabs".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'documentId' + '}', document_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(tabs) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Tabs') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_document_tabs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns a URL to the edit view UI. # Returns a URL that allows you to embed the edit view of the DocuSign UI in your applications. This is a one-time use login token that allows the user to be placed into the DocuSign editing view. Upon sending completion, the user is returned to the return URL provided by the API application. Important: iFrames should not be used for embedded operations on mobile devices due to screen space issues. For iOS devices DocuSign recommends using a WebView. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param return_url_request (optional parameter) # @return [ViewUrl] def create_edit_view(account_id, envelope_id, return_url_request) data, _status_code, _headers = create_edit_view_with_http_info(account_id, envelope_id, return_url_request) return data end # Returns a URL to the edit view UI. # Returns a URL that allows you to embed the edit view of the DocuSign UI in your applications. This is a one-time use login token that allows the user to be placed into the DocuSign editing view. Upon sending completion, the user is returned to the return URL provided by the API application. Important: iFrames should not be used for embedded operations on mobile devices due to screen space issues. For iOS devices DocuSign recommends using a WebView. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param return_url_request (optional parameter) # @return [Array<(ViewUrl, Fixnum, Hash)>] ViewUrl data, response status code and response headers def create_edit_view_with_http_info(account_id, envelope_id, return_url_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_edit_view ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_edit_view" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_edit_view" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/edit".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(return_url_request) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ViewUrl') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_edit_view\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Adds email setting overrides to an envelope. # Adds email override settings, changing the email address to reply to an email address, name, or the BCC for email archive information, for the envelope. Note that adding email settings will only affect email communications that occur after the addition was made. ### Important: The BCC Email address feature is designed to provide a copy of all email communications for external archiving purposes. DocuSign recommends that envelopes sent using the BCC for Email Archive feature, including the BCC Email Override option, include additional signer authentication options. To send a copy of the envelope to a recipient who does not need to sign, use a Carbon Copies or Certified Deliveries Recipient Type. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param email_settings (optional parameter) # @return [EmailSettings] def create_email_settings(account_id, envelope_id, email_settings) data, _status_code, _headers = create_email_settings_with_http_info(account_id, envelope_id, email_settings) return data end # Adds email setting overrides to an envelope. # Adds email override settings, changing the email address to reply to an email address, name, or the BCC for email archive information, for the envelope. Note that adding email settings will only affect email communications that occur after the addition was made. ### Important: The BCC Email address feature is designed to provide a copy of all email communications for external archiving purposes. DocuSign recommends that envelopes sent using the BCC for Email Archive feature, including the BCC Email Override option, include additional signer authentication options. To send a copy of the envelope to a recipient who does not need to sign, use a Carbon Copies or Certified Deliveries Recipient Type. # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param email_settings (optional parameter) # @return [Array<(EmailSettings, Fixnum, Hash)>] EmailSettings data, response status code and response headers def create_email_settings_with_http_info(account_id, envelope_id, email_settings) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_email_settings ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_email_settings" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_email_settings" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/email_settings".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(email_settings) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'EmailSettings') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_email_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Creates an envelope. # Creates an envelope. Using this function you can: * Create an envelope and send it. * Create an envelope from an existing template and send it. In either case, you can choose to save the envelope as a draft envelope instead of sending it by setting the request's `status` property to `created` instead of `sent`. ## Sending Envelopes Documents can be included with the Envelopes::create call itself or a template can include documents. Documents can be added by using a multi-part/form request or by using the `documentBase64` field of the [`document` object](#/definitions/document) ### Recipient Types An [`envelopeDefinition` object](#/definitions/envelopeDefinition) is used as the method's body. Envelope recipients can be defined in the envelope or in templates. The `envelopeDefinition` object's `recipients` field is an [`EnvelopeRecipients` resource object](#/definitions/EnvelopeRecipients). It includes arrays of the seven types of recipients defined by DocuSign: Recipient type | Object definition -------------- | ----------------- agent (can add name and email information for later recipients/signers) | [`agent`](#/definitions/agent) carbon copy (receives a copy of the documents) | [`carbonCopy`](#/definitions/carbonCopy) certified delivery (receives a copy of the documents and must acknowledge receipt) | [`certifiedDelivery`](#/definitions/certifiedDelivery) editor (can change recipients and document fields for later recipients/signers) | [`editor`](#/definitions/editor) in-person signer (\"hosts\" someone who signs in-person) | [`inPersonSigner`](#/definitions/inPersonSigner) intermediary (can add name and email information for some later recipients/signers.) | [`intermediary`](#/definitions/intermediary) signer (signs and/or updates document fields) | [`signer`](#/definitions/signer) Additional information about the different types of recipients is available from the [`EnvelopeRecipients` resource page](../../EnvelopeRecipients) and from the [Developer Center](https://www.docusign.com/developer-center/explore/features/recipients) ### Tabs Tabs (also referred to as `tags` and as `fields` in the web sending user interface), can be defined in the `envelopeDefinition`, in templates, by transforming PDF Form Fields, or by using Composite Templates (see below). Defining tabs: the `inPersonSigner`, and `signer` recipient objects include a `tabs` field. It is an [`EnvelopeTabs` resource object](#/definitions/EnvelopeTabs). It includes arrays of the 24 different tab types available. See the [`EnvelopeTabs` resource](../../EnvelopeTabs) for more information. ## Using Templates Envelopes use specific people or groups as recipients. Templates can specify a role, eg `account_manager.` When a template is used in an envelope, the roles must be replaced with specific people or groups. When you create an envelope using a `templateId`, the different recipient type objects within the [`EnvelopeRecipients` object](#/definitions/EnvelopeRecipients) are used to assign recipients to the template's roles via the `roleName` property. The recipient objects can also override settings that were specified in the template, and set values for tab fields that were defined in the template. ### Message Lock When a template is added or applied to an envelope and the template has a locked email subject and message, that subject and message are used for the envelope and cannot be changed even if another locked template is subsequently added or applied to the envelope. The field `messageLock` is used to lock the email subject and message. If an email subject or message is entered before adding or applying a template with `messageLock` **true**, the email subject and message is overwritten with the locked email subject and message from the template. ## Envelope Status The status of sent envelopes can be determined through the DocuSign webhook system or by polling. Webhooks are highly recommended: they provide your application with the quickest updates when an envelope's status changes. DocuSign limits polling to once every 15 minutes or less frequently. When a webhook is used, DocuSign calls your application, via the URL you provide, with a notification XML message. See the [Webhook recipe](https://www.docusign.com/developer-center/recipes/webhook-status) for examples and live demos of using webhooks. ## Webhook Options The two webhook options, *eventNotification* and *Connect* use the same notification mechanism and message formats. eventNotification is used to create a webhook for a specific envelope sent via the API. Connect webhooks can be used for any envelope sent from an account, from any user, from any client. ### eventNotification Webhooks The Envelopes::create method includes an optional [eventNotification object](#definition-eventNotification) that adds a webhook to the envelope. eventNotification webhooks are available for all DocuSign accounts with API access. ### Connect Webhooks Connect can be used to create a webhook for all envelopes sent by all users in an account, either through the API or via other DocuSign clients (web, mobile, etc). Connect configurations are independent of specific envelopes. A Connect configuration includes a filter that may be used to limit the webhook to specific users, envelope statuses, etc. Connect configurations may be created and managed using the [ConnectConfigurations resource](../../Connect/ConnectConfigurations). Configurations can also be created and managed from the Administration tool accessed by selecting \"Go to Admin\" from the menu next to your picture on the DocuSign web app. See the Integrations/Connect section of the Admin tool. For repeatability, and to minimize support questions, creating Connect configurations via the API is recommended, especially for ISVs. Connect is available for some DocuSign account types. Please contact DocuSign Sales for more information. ## Composite Templates The Composite Templates feature, like [compositing in film production](https://en.wikipedia.org/wiki/Compositing), enables you to *overlay* document, recipient, and tab definitions from multiple sources, including PDF Form Field definitions, templates defined on the server, and more. Each Composite Template consists of optional elements: server templates, inline templates, PDF Metadata templates, and documents. * The Composite Template ID is an optional element used to identify the composite template. It is used as a reference when adding document object information via a multi-part HTTP message. If used, the document content-disposition must include the `compositeTemplateId` to which the document should be added. If `compositeTemplateId` is not specified in the content-disposition, the document is applied based on the `documentId` only. If no document object is specified, the composite template inherits the first document. * Server Templates are server-side templates stored on the DocuSign platform. If supplied, they are overlaid into the envelope in the order of their Sequence value. * Inline Templates provide a container to add documents, recipients, tabs, and custom fields. If inline templates are supplied, they are overlaid into the envelope in the order of their Sequence value. * Document objects are optional structures that provide a container to pass in a document or form. If this object is not included, the composite template inherits the *first* document it finds from a server template or inline template, starting with the lowest sequence value. PDF Form objects are only transformed from the document object. DocuSign does not derive PDF form properties from server templates or inline templates. To instruct DocuSign to transform fields from the PDF form, set `transformPdfFields` to \"true\" for the document. See the Transform PDF Fields section for more information about process. * PDF Metadata Templates provide a container to embed design-time template information into a PDF document. DocuSign uses this information when processing the Envelope. This convention allows the document to carry the signing instructions with it, so that less information needs to be provided at run-time through an inline template or synchronized with an external structure like a server template. PDF Metadata templates are stored in the Metadata layer of a PDF in accordance with Acrobat's XMP specification. DocuSign will only find PDF Metadata templates inside documents passed in the Document object (see below). If supplied, the PDF metadata template will be overlaid into the envelope in the order of its Sequence value. ### Compositing the definitions Each Composite Template adds a new document and templates overlay into the envelope. For each Composite Template these rules are applied: * Templates are overlaid in the order of their Sequence value. * If Document is not passed into the Composite Template's `document` field, the *first* template's document (based on the template's Sequence value) is used. * Last in wins in all cases except for the document (i.e. envelope information, recipient information, secure field information). There is no special casing. For example, if you want higher security on a tab, then that needs to be specified in a later template (by sequence number) then where the tab is included. If you want higher security on a role recipient, then it needs to be in a later template then where that role recipient is specified. * Recipient matching is based on Recipient Role and Routing Order. If there are matches, the recipient information is merged together. A final pass is done on all Composite Templates, after all template overlays have been applied, to collapse recipients with the same email, username and routing order. This prevents having the same recipients at the same routing order. * If you specify in a template that a recipient is locked, once that recipient is overlaid the recipient attributes can no longer be changed. The only items that can be changed for the recipient in this case are the email, username, access code and IDCheckInformationInput. * Tab matching is based on Tab Labels, Tab Types and Documents. If a Tab Label matches but the Document is not supplied, the Tab is overlaid for all the Documents. For example, if you have a simple inline template with only one tab in it with a label and a value, the Signature, Initial, Company, Envelope ID, User Name tabs will only be matched and collapsed if they fall in the exact same X and Y locations. * roleName and tabLabel matching is case sensitive. * The defaultRecipient field enables you to specify which recipient the generated tabs from a PDF form are mapped to. You can also set PDF form generated tabs to a recipient other than the DefaultRecipient by specifying the mapping of the tab label that is created to one of the template recipients. * You can use tabLabel wild carding to map a series of tabs from the PDF form. To use this you must end a tab label with \"\\*\" and then the system matches tabs that start with the label. * If no DefaultRecipient is specified, tabs must be explicitly mapped to recipients in order to be generated from the form. Unmapped form objects will not be generated into their DocuSign equivalents. (In the case of Signature/Initials, the tabs will be disregarded entirely; in the case of pdf text fields, the field data will be flattened on the Envelope document, but there will not be a corresponding DocuSign data tab.) ### Including the Document Content for Composite Templates Document content can be supplied inline, using the `documentBase64` or can be included in a multi-part HTTP message. If a multi-part message is used and there are multiple Composite Templates, the document content-disposition can include the `compositeTemplateId` to which the document should be added. Using the `compositeTemplateId` sets which documents are associated with particular composite templates. An example of this usage is: ``` --5cd3320a-5aac-4453-b3a4-cbb52a4cba5d Content-Type: application/pdf Content-Disposition: file; filename=\"eula.pdf\"; documentId=1; compositeTemplateId=\"1\" Content-Transfer-Encoding: base64 ``` ### PDF Form Field Transformation Only the following PDF Form FieldTypes will be transformed to DocuSign tabs: CheckBox, DateTime, ListBox, Numeric, Password, Radio, Signature, and Text Field Properties that will be transformed: Read Only, Required, Max Length, Positions, and Initial Data. When transforming a *PDF Form Digital Signature Field,* the following rules are used: If the PDF Field Name Contains | Then the DocuSign Tab Will be ------- | -------- DocuSignSignHere or eSignSignHere | Signature DocuSignSignHereOptional or eSignSignHereOptional | Optional Signature DocuSignInitialHere or eSignInitialHere | Initials DocuSignInitialHereOptional or eSignInitialHereOptional | Optional Initials Any other PDF Form Digital Signature Field will be transformed to a DocuSign Signature tab When transforming *PDF Form Text Fields,* the following rules are used: If the PDF Field Name Contains | Then the DocuSign Tab Will be ------- | -------- DocuSignSignHere or eSignSignHere | Signature DocuSignSignHereOptional or eSignSignHereOptional | Optional Signature DocuSignInitialHere or eSignInitialHere | Initials DocuSignInitialHereOptional or eSignInitialHereOptional | Optional Initials DocuSignEnvelopeID or eSignEnvelopeID | EnvelopeID DocuSignCompany or eSignCompany | Company DocuSignDateSigned or eSignDateSigned | Date Signed DocuSignTitle or eSignTitle | Title DocuSignFullName or eSignFullName | Full Name DocuSignSignerAttachmentOptional or eSignSignerAttachmentOptional | Optional Signer Attachment Any other PDF Form Text Field will be transformed to a DocuSign data (text) tab. PDF Form Field Names that include \"DocuSignIgnoreTransform\" or \"eSignIgnoreTransform\" will not be transformed. PDF Form Date fields will be transformed to Date Signed fields if their name includes DocuSignDateSigned or eSignDateSigned. ## Template Email Subject Merge Fields This feature enables you to insert 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 `roleName`, are added to the `emailSubject` 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. 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` when creating the template or when sending an envelope from a template: [[_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 when creating the template or when sending an envelope from a template: [[_Email]] Example: `\"emailSubject\":\"[[Signer 1_Email]], Please sign this NDA\",` In both cases the is the recipient's `roleName` 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 [[_UserName]] or [[_Email]] is shown in the email subject. ## Branding an envelope The following rules are used to determine the `brandId` used in an envelope: * If a `brandId` is specified in the envelope/template and that brandId is available to the account, that brand is used in the envelope. * If more than one template is used in an envelope and more than one `brandId` is specified, the first `brandId` specified is used throughout the envelope. * In cases where no brand is specified and the sender belongs to a Group; if there is only one brand associated with the Group, then that brand is used in the envelope. Otherwise, the account's default signing brand is used. * For envelopes that do not meet any of the previous criteria, the account's default signing brand is used for the envelope. ## BCC Email address feature The BCC Email address feature is designed to provide a copy of all email communications for external archiving purposes. DocuSign recommends that envelopes sent using the BCC for Email Archive feature, including the BCC Email Override option, include additional signer authentication options. To send a copy of the envelope to a recipient who does not need to sign, don't use the BCC Email field. Use a Carbon Copy or Certified Delivery Recipient type. ## Merge Recipient Roles for Draft Envelopes When an envelope with multiple templates is sent, the recipients from the templates are merged according to the template roles, and empty recipients are removed. When creating an envelope with multiple templates, but not sending it (keeping it in a created state), duplicate recipients are not merged, which could cause leave duplicate recipients in the envelope. To prevent this, the query parameter `merge_roles_on_draft` should be added when posting a draft envelope (status=created) with multiple templates. Doing this will merge template roles and remove empty recipients. ###### Note: DocuSign recommends that the `merge_roles_on_draft` query parameter be used anytime you are creating an envelope with multiple templates and keeping it in draft (created) status. # @param account_id The external account number (int) or account ID Guid. # @param envelope_definition (optional parameter) # @param DocuSign_eSign::CreateEnvelopeOptions Options for modifying the behavior of the function. # @return [EnvelopeSummary] def create_envelope(account_id, envelope_definition, options = DocuSign_eSign::CreateEnvelopeOptions.default) data, _status_code, _headers = create_envelope_with_http_info(account_id, envelope_definition, options) return data end # Creates an envelope. # Creates an envelope. Using this function you can: * Create an envelope and send it. * Create an envelope from an existing template and send it. In either case, you can choose to save the envelope as a draft envelope instead of sending it by setting the request's `status` property to `created` instead of `sent`. ## Sending Envelopes Documents can be included with the Envelopes::create call itself or a template can include documents. Documents can be added by using a multi-part/form request or by using the `documentBase64` field of the [`document` object](#/definitions/document) ### Recipient Types An [`envelopeDefinition` object](#/definitions/envelopeDefinition) is used as the method's body. Envelope recipients can be defined in the envelope or in templates. The `envelopeDefinition` object's `recipients` field is an [`EnvelopeRecipients` resource object](#/definitions/EnvelopeRecipients). It includes arrays of the seven types of recipients defined by DocuSign: Recipient type | Object definition -------------- | ----------------- agent (can add name and email information for later recipients/signers) | [`agent`](#/definitions/agent) carbon copy (receives a copy of the documents) | [`carbonCopy`](#/definitions/carbonCopy) certified delivery (receives a copy of the documents and must acknowledge receipt) | [`certifiedDelivery`](#/definitions/certifiedDelivery) editor (can change recipients and document fields for later recipients/signers) | [`editor`](#/definitions/editor) in-person signer (\"hosts\" someone who signs in-person) | [`inPersonSigner`](#/definitions/inPersonSigner) intermediary (can add name and email information for some later recipients/signers.) | [`intermediary`](#/definitions/intermediary) signer (signs and/or updates document fields) | [`signer`](#/definitions/signer) Additional information about the different types of recipients is available from the [`EnvelopeRecipients` resource page](../../EnvelopeRecipients) and from the [Developer Center](https://www.docusign.com/developer-center/explore/features/recipients) ### Tabs Tabs (also referred to as `tags` and as `fields` in the web sending user interface), can be defined in the `envelopeDefinition`, in templates, by transforming PDF Form Fields, or by using Composite Templates (see below). Defining tabs: the `inPersonSigner`, and `signer` recipient objects include a `tabs` field. It is an [`EnvelopeTabs` resource object](#/definitions/EnvelopeTabs). It includes arrays of the 24 different tab types available. See the [`EnvelopeTabs` resource](../../EnvelopeTabs) for more information. ## Using Templates Envelopes use specific people or groups as recipients. Templates can specify a role, eg `account_manager.` When a template is used in an envelope, the roles must be replaced with specific people or groups. When you create an envelope using a `templateId`, the different recipient type objects within the [`EnvelopeRecipients` object](#/definitions/EnvelopeRecipients) are used to assign recipients to the template's roles via the `roleName` property. The recipient objects can also override settings that were specified in the template, and set values for tab fields that were defined in the template. ### Message Lock When a template is added or applied to an envelope and the template has a locked email subject and message, that subject and message are used for the envelope and cannot be changed even if another locked template is subsequently added or applied to the envelope. The field `messageLock` is used to lock the email subject and message. If an email subject or message is entered before adding or applying a template with `messageLock` **true**, the email subject and message is overwritten with the locked email subject and message from the template. ## Envelope Status The status of sent envelopes can be determined through the DocuSign webhook system or by polling. Webhooks are highly recommended: they provide your application with the quickest updates when an envelope's status changes. DocuSign limits polling to once every 15 minutes or less frequently. When a webhook is used, DocuSign calls your application, via the URL you provide, with a notification XML message. See the [Webhook recipe](https://www.docusign.com/developer-center/recipes/webhook-status) for examples and live demos of using webhooks. ## Webhook Options The two webhook options, *eventNotification* and *Connect* use the same notification mechanism and message formats. eventNotification is used to create a webhook for a specific envelope sent via the API. Connect webhooks can be used for any envelope sent from an account, from any user, from any client. ### eventNotification Webhooks The Envelopes::create method includes an optional [eventNotification object](#definition-eventNotification) that adds a webhook to the envelope. eventNotification webhooks are available for all DocuSign accounts with API access. ### Connect Webhooks Connect can be used to create a webhook for all envelopes sent by all users in an account, either through the API or via other DocuSign clients (web, mobile, etc). Connect configurations are independent of specific envelopes. A Connect configuration includes a filter that may be used to limit the webhook to specific users, envelope statuses, etc. Connect configurations may be created and managed using the [ConnectConfigurations resource](../../Connect/ConnectConfigurations). Configurations can also be created and managed from the Administration tool accessed by selecting \"Go to Admin\" from the menu next to your picture on the DocuSign web app. See the Integrations/Connect section of the Admin tool. For repeatability, and to minimize support questions, creating Connect configurations via the API is recommended, especially for ISVs. Connect is available for some DocuSign account types. Please contact DocuSign Sales for more information. ## Composite Templates The Composite Templates feature, like [compositing in film production](https://en.wikipedia.org/wiki/Compositing), enables you to *overlay* document, recipient, and tab definitions from multiple sources, including PDF Form Field definitions, templates defined on the server, and more. Each Composite Template consists of optional elements: server templates, inline templates, PDF Metadata templates, and documents. * The Composite Template ID is an optional element used to identify the composite template. It is used as a reference when adding document object information via a multi-part HTTP message. If used, the document content-disposition must include the `compositeTemplateId` to which the document should be added. If `compositeTemplateId` is not specified in the content-disposition, the document is applied based on the `documentId` only. If no document object is specified, the composite template inherits the first document. * Server Templates are server-side templates stored on the DocuSign platform. If supplied, they are overlaid into the envelope in the order of their Sequence value. * Inline Templates provide a container to add documents, recipients, tabs, and custom fields. If inline templates are supplied, they are overlaid into the envelope in the order of their Sequence value. * Document objects are optional structures that provide a container to pass in a document or form. If this object is not included, the composite template inherits the *first* document it finds from a server template or inline template, starting with the lowest sequence value. PDF Form objects are only transformed from the document object. DocuSign does not derive PDF form properties from server templates or inline templates. To instruct DocuSign to transform fields from the PDF form, set `transformPdfFields` to \"true\" for the document. See the Transform PDF Fields section for more information about process. * PDF Metadata Templates provide a container to embed design-time template information into a PDF document. DocuSign uses this information when processing the Envelope. This convention allows the document to carry the signing instructions with it, so that less information needs to be provided at run-time through an inline template or synchronized with an external structure like a server template. PDF Metadata templates are stored in the Metadata layer of a PDF in accordance with Acrobat's XMP specification. DocuSign will only find PDF Metadata templates inside documents passed in the Document object (see below). If supplied, the PDF metadata template will be overlaid into the envelope in the order of its Sequence value. ### Compositing the definitions Each Composite Template adds a new document and templates overlay into the envelope. For each Composite Template these rules are applied: * Templates are overlaid in the order of their Sequence value. * If Document is not passed into the Composite Template's `document` field, the *first* template's document (based on the template's Sequence value) is used. * Last in wins in all cases except for the document (i.e. envelope information, recipient information, secure field information). There is no special casing. For example, if you want higher security on a tab, then that needs to be specified in a later template (by sequence number) then where the tab is included. If you want higher security on a role recipient, then it needs to be in a later template then where that role recipient is specified. * Recipient matching is based on Recipient Role and Routing Order. If there are matches, the recipient information is merged together. A final pass is done on all Composite Templates, after all template overlays have been applied, to collapse recipients with the same email, username and routing order. This prevents having the same recipients at the same routing order. * If you specify in a template that a recipient is locked, once that recipient is overlaid the recipient attributes can no longer be changed. The only items that can be changed for the recipient in this case are the email, username, access code and IDCheckInformationInput. * Tab matching is based on Tab Labels, Tab Types and Documents. If a Tab Label matches but the Document is not supplied, the Tab is overlaid for all the Documents. For example, if you have a simple inline template with only one tab in it with a label and a value, the Signature, Initial, Company, Envelope ID, User Name tabs will only be matched and collapsed if they fall in the exact same X and Y locations. * roleName and tabLabel matching is case sensitive. * The defaultRecipient field enables you to specify which recipient the generated tabs from a PDF form are mapped to. You can also set PDF form generated tabs to a recipient other than the DefaultRecipient by specifying the mapping of the tab label that is created to one of the template recipients. * You can use tabLabel wild carding to map a series of tabs from the PDF form. To use this you must end a tab label with \"\\*\" and then the system matches tabs that start with the label. * If no DefaultRecipient is specified, tabs must be explicitly mapped to recipients in order to be generated from the form. Unmapped form objects will not be generated into their DocuSign equivalents. (In the case of Signature/Initials, the tabs will be disregarded entirely; in the case of pdf text fields, the field data will be flattened on the Envelope document, but there will not be a corresponding DocuSign data tab.) ### Including the Document Content for Composite Templates Document content can be supplied inline, using the `documentBase64` or can be included in a multi-part HTTP message. If a multi-part message is used and there are multiple Composite Templates, the document content-disposition can include the `compositeTemplateId` to which the document should be added. Using the `compositeTemplateId` sets which documents are associated with particular composite templates. An example of this usage is: ``` --5cd3320a-5aac-4453-b3a4-cbb52a4cba5d Content-Type: application/pdf Content-Disposition: file; filename=\"eula.pdf\"; documentId=1; compositeTemplateId=\"1\" Content-Transfer-Encoding: base64 ``` ### PDF Form Field Transformation Only the following PDF Form FieldTypes will be transformed to DocuSign tabs: CheckBox, DateTime, ListBox, Numeric, Password, Radio, Signature, and Text Field Properties that will be transformed: Read Only, Required, Max Length, Positions, and Initial Data. When transforming a *PDF Form Digital Signature Field,* the following rules are used: If the PDF Field Name Contains | Then the DocuSign Tab Will be ------- | -------- DocuSignSignHere or eSignSignHere | Signature DocuSignSignHereOptional or eSignSignHereOptional | Optional Signature DocuSignInitialHere or eSignInitialHere | Initials DocuSignInitialHereOptional or eSignInitialHereOptional | Optional Initials Any other PDF Form Digital Signature Field will be transformed to a DocuSign Signature tab When transforming *PDF Form Text Fields,* the following rules are used: If the PDF Field Name Contains | Then the DocuSign Tab Will be ------- | -------- DocuSignSignHere or eSignSignHere | Signature DocuSignSignHereOptional or eSignSignHereOptional | Optional Signature DocuSignInitialHere or eSignInitialHere | Initials DocuSignInitialHereOptional or eSignInitialHereOptional | Optional Initials DocuSignEnvelopeID or eSignEnvelopeID | EnvelopeID DocuSignCompany or eSignCompany | Company DocuSignDateSigned or eSignDateSigned | Date Signed DocuSignTitle or eSignTitle | Title DocuSignFullName or eSignFullName | Full Name DocuSignSignerAttachmentOptional or eSignSignerAttachmentOptional | Optional Signer Attachment Any other PDF Form Text Field will be transformed to a DocuSign data (text) tab. PDF Form Field Names that include \"DocuSignIgnoreTransform\" or \"eSignIgnoreTransform\" will not be transformed. PDF Form Date fields will be transformed to Date Signed fields if their name includes DocuSignDateSigned or eSignDateSigned. ## Template Email Subject Merge Fields This feature enables you to insert 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 `roleName`, are added to the `emailSubject` 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. 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` 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 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 `roleName` 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. ## Branding an envelope The following rules are used to determine the `brandId` used in an envelope: * If a `brandId` is specified in the envelope/template and that brandId is available to the account, that brand is used in the envelope. * If more than one template is used in an envelope and more than one `brandId` is specified, the first `brandId` specified is used throughout the envelope. * In cases where no brand is specified and the sender belongs to a Group; if there is only one brand associated with the Group, then that brand is used in the envelope. Otherwise, the account's default signing brand is used. * For envelopes that do not meet any of the previous criteria, the account's default signing brand is used for the envelope. ## BCC Email address feature The BCC Email address feature is designed to provide a copy of all email communications for external archiving purposes. DocuSign recommends that envelopes sent using the BCC for Email Archive feature, including the BCC Email Override option, include additional signer authentication options. To send a copy of the envelope to a recipient who does not need to sign, don't use the BCC Email field. Use a Carbon Copy or Certified Delivery Recipient type. ## Merge Recipient Roles for Draft Envelopes When an envelope with multiple templates is sent, the recipients from the templates are merged according to the template roles, and empty recipients are removed. When creating an envelope with multiple templates, but not sending it (keeping it in a created state), duplicate recipients are not merged, which could cause leave duplicate recipients in the envelope. To prevent this, the query parameter `merge_roles_on_draft` should be added when posting a draft envelope (status=created) with multiple templates. Doing this will merge template roles and remove empty recipients. ###### Note: DocuSign recommends that the `merge_roles_on_draft` query parameter be used anytime you are creating an envelope with multiple templates and keeping it in draft (created) status. # @param account_id The external account number (int) or account ID Guid. # @param envelope_definition (optional parameter) # @param DocuSign_eSign::CreateEnvelopeOptions Options for modifying the behavior of the function. # @return [Array<(EnvelopeSummary, Fixnum, Hash)>] EnvelopeSummary data, response status code and response headers def create_envelope_with_http_info(account_id, envelope_definition, options = DocuSign_eSign::CreateEnvelopeOptions.default) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_envelope ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_envelope" if account_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s) # query parameters query_params = {} query_params[:'cdse_mode'] = options.cdse_mode if !options.cdse_mode.nil? query_params[:'change_routing_order'] = options.change_routing_order if !options.change_routing_order.nil? query_params[:'completed_documents_only'] = options.completed_documents_only if !options.completed_documents_only.nil? query_params[:'merge_roles_on_draft'] = options.merge_roles_on_draft if !options.merge_roles_on_draft.nil? query_params[:'tab_label_exact_matches'] = options.tab_label_exact_matches if !options.tab_label_exact_matches.nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(envelope_definition) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'EnvelopeSummary') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_envelope\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Posts a list of comments for authorized user # # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param comments_publish (optional parameter) # @return [CommentHistoryResult] def create_envelope_comments(account_id, envelope_id, comments_publish) data, _status_code, _headers = create_envelope_comments_with_http_info(account_id, envelope_id, comments_publish) return data end # Posts a list of comments for authorized user # # @param account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param comments_publish (optional parameter) # @return [Array<(CommentHistoryResult, Fixnum, Hash)>] CommentHistoryResult data, response status code and response headers def create_envelope_comments_with_http_info(account_id, envelope_id, comments_publish) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_envelope_comments ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_envelope_comments" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_envelope_comments" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/comments".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(comments_publish) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CommentHistoryResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_envelope_comments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Provides a URL to start a recipient view of the Envelope UI # This method returns a URL for an envelope 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 account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param recipient_preview_request (optional parameter) # @return [ViewUrl] def create_envelope_recipient_preview(account_id, envelope_id, recipient_preview_request) data, _status_code, _headers = create_envelope_recipient_preview_with_http_info(account_id, envelope_id, recipient_preview_request) return data end # Provides a URL to start a recipient view of the Envelope UI # This method returns a URL for an envelope 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 account_id The external account number (int) or account ID Guid. # @param envelope_id The envelopeId Guid of the envelope being accessed. # @param recipient_preview_request (optional parameter) # @return [Array<(ViewUrl, Fixnum, Hash)>] ViewUrl data, response status code and response headers def create_envelope_recipient_preview_with_http_info(account_id, envelope_id, recipient_preview_request) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: EnvelopesApi.create_envelope_recipient_preview ..." end # verify the required parameter 'account_id' is set fail ArgumentError, "Missing the required parameter 'account_id' when calling EnvelopesApi.create_envelope_recipient_preview" if account_id.nil? # verify the required parameter 'envelope_id' is set fail ArgumentError, "Missing the required parameter 'envelope_id' when calling EnvelopesApi.create_envelope_recipient_preview" if envelope_id.nil? # resource path local_var_path = "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient_preview".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(recipient_preview_request) auth_names = [] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ViewUrl') if @api_client.config.debugging @api_client.config.logger.debug "API called: EnvelopesApi#create_envelope_recipient_preview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Provides a URL to start a shared recipient view of the Envelope UI # Returns a URL that enables you to embed the DocuSign UI recipient view of a [shared envelope](https://support.docusign.com/en/guides/ndse-admin-guide-share-envelopes) in your applications. This is the view that a user sees of an envelope that a recipient on the same account has shared with them. Due to screen space issues, do not use an `