=begin #Dropbox Sign API #Dropbox Sign v3 API The version of the OpenAPI document: 3.0.0 Contact: apisupport@hellosign.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.3.0 =end require 'cgi' module Dropbox end module Dropbox::Sign class SignatureRequestApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Embedded Bulk Send with Template # Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE**: Only available for Standard plan and higher. # @param signature_request_bulk_create_embedded_with_template_request [SignatureRequestBulkCreateEmbeddedWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [BulkSendJobSendResponse] def signature_request_bulk_create_embedded_with_template(signature_request_bulk_create_embedded_with_template_request, opts = {}) data, _status_code, _headers = signature_request_bulk_create_embedded_with_template_with_http_info(signature_request_bulk_create_embedded_with_template_request, opts) data end # Embedded Bulk Send with Template # Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter to be signed in an embedded iFrame. These embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. **NOTE**: Only available for Standard plan and higher. # @param signature_request_bulk_create_embedded_with_template_request [SignatureRequestBulkCreateEmbeddedWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [Array<(BulkSendJobSendResponse, Integer, Hash)>] BulkSendJobSendResponse data, response status code and response headers def signature_request_bulk_create_embedded_with_template_with_http_info(signature_request_bulk_create_embedded_with_template_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_bulk_create_embedded_with_template ...' end # verify the required parameter 'signature_request_bulk_create_embedded_with_template_request' is set if @api_client.config.client_side_validation && signature_request_bulk_create_embedded_with_template_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_bulk_create_embedded_with_template_request' when calling SignatureRequestApi.signature_request_bulk_create_embedded_with_template" end # resource path local_var_path = '/signature_request/bulk_create_embedded_with_template' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_bulk_create_embedded_with_template_request, Dropbox::Sign::SignatureRequestBulkCreateEmbeddedWithTemplateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'BulkSendJobSendResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_bulk_create_embedded_with_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::BulkSendJobSendResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_bulk_create_embedded_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Bulk Send with Template # Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE**: Only available for Standard plan and higher. # @param signature_request_bulk_send_with_template_request [SignatureRequestBulkSendWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [BulkSendJobSendResponse] def signature_request_bulk_send_with_template(signature_request_bulk_send_with_template_request, opts = {}) data, _status_code, _headers = signature_request_bulk_send_with_template_with_http_info(signature_request_bulk_send_with_template_request, opts) data end # Bulk Send with Template # Creates BulkSendJob which sends up to 250 SignatureRequests in bulk based off of the provided Template(s) specified with the `template_ids` parameter. **NOTE**: Only available for Standard plan and higher. # @param signature_request_bulk_send_with_template_request [SignatureRequestBulkSendWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [Array<(BulkSendJobSendResponse, Integer, Hash)>] BulkSendJobSendResponse data, response status code and response headers def signature_request_bulk_send_with_template_with_http_info(signature_request_bulk_send_with_template_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_bulk_send_with_template ...' end # verify the required parameter 'signature_request_bulk_send_with_template_request' is set if @api_client.config.client_side_validation && signature_request_bulk_send_with_template_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_bulk_send_with_template_request' when calling SignatureRequestApi.signature_request_bulk_send_with_template" end # resource path local_var_path = '/signature_request/bulk_send_with_template' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_bulk_send_with_template_request, Dropbox::Sign::SignatureRequestBulkSendWithTemplateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'BulkSendJobSendResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_bulk_send_with_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::BulkSendJobSendResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_bulk_send_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Cancel Incomplete Signature Request # Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE**: To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. # @param signature_request_id [String] The id of the incomplete SignatureRequest to cancel. # @param [Hash] opts the optional parameters # @return [nil] def signature_request_cancel(signature_request_id, opts = {}) signature_request_cancel_with_http_info(signature_request_id, opts) nil end # Cancel Incomplete Signature Request # Cancels an incomplete signature request. This action is **not reversible**. The request will be canceled and signers will no longer be able to sign. If they try to access the signature request they will receive a HTTP 410 status code indicating that the resource has been deleted. Cancelation is asynchronous and a successful call to this endpoint will return an empty 200 OK response if the signature request is eligible to be canceled and has been successfully queued. This 200 OK response does not indicate a successful cancelation of the signature request itself. The cancelation is confirmed via the `signature_request_canceled` event. It is recommended that a [callback handler](/api/reference/tag/Callbacks-and-Events) be implemented to listen for the `signature_request_canceled` event. This callback will be sent only when the cancelation has completed successfully. If a callback handler has been configured and the event has not been received within 60 minutes of making the call, check the status of the request in the [API Dashboard](https://app.hellosign.com/apidashboard) and retry the cancelation if necessary. To be eligible for cancelation, a signature request must have been sent successfully, must not yet have been signed by all signers, and you must either be the sender or own the API app under which it was sent. A partially signed signature request can be canceled. **NOTE**: To remove your access to a completed signature request, use the endpoint: `POST /signature_request/remove/[:signature_request_id]`. # @param signature_request_id [String] The id of the incomplete SignatureRequest to cancel. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def signature_request_cancel_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_cancel ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_cancel" end # resource path local_var_path = '/signature_request/cancel/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_cancel", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_cancel\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Embedded Signature Request # Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # @param signature_request_create_embedded_request [SignatureRequestCreateEmbeddedRequest] # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_create_embedded(signature_request_create_embedded_request, opts = {}) data, _status_code, _headers = signature_request_create_embedded_with_http_info(signature_request_create_embedded_request, opts) data end # Create Embedded Signature Request # Creates a new SignatureRequest with the submitted documents to be signed in an embedded iFrame. If form_fields_per_document is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. <u>Note</u> that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # @param signature_request_create_embedded_request [SignatureRequestCreateEmbeddedRequest] # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_create_embedded_with_http_info(signature_request_create_embedded_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_create_embedded ...' end # verify the required parameter 'signature_request_create_embedded_request' is set if @api_client.config.client_side_validation && signature_request_create_embedded_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_create_embedded_request' when calling SignatureRequestApi.signature_request_create_embedded" end # resource path local_var_path = '/signature_request/create_embedded' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_create_embedded_request, Dropbox::Sign::SignatureRequestCreateEmbeddedRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_create_embedded", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_create_embedded\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create Embedded Signature Request with Template # Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. Note that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # @param signature_request_create_embedded_with_template_request [SignatureRequestCreateEmbeddedWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_create_embedded_with_template(signature_request_create_embedded_with_template_request, opts = {}) data, _status_code, _headers = signature_request_create_embedded_with_template_with_http_info(signature_request_create_embedded_with_template_request, opts) data end # Create Embedded Signature Request with Template # Creates a new SignatureRequest based on the given Template(s) to be signed in an embedded iFrame. <u>Note</u> that embedded signature requests can only be signed in embedded iFrames whereas normal signature requests can only be signed on Dropbox Sign. # @param signature_request_create_embedded_with_template_request [SignatureRequestCreateEmbeddedWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_create_embedded_with_template_with_http_info(signature_request_create_embedded_with_template_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_create_embedded_with_template ...' end # verify the required parameter 'signature_request_create_embedded_with_template_request' is set if @api_client.config.client_side_validation && signature_request_create_embedded_with_template_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_create_embedded_with_template_request' when calling SignatureRequestApi.signature_request_create_embedded_with_template" end # resource path local_var_path = '/signature_request/create_embedded_with_template' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_create_embedded_with_template_request, Dropbox::Sign::SignatureRequestCreateEmbeddedWithTemplateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_create_embedded_with_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_create_embedded_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download Files # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @option opts [String] :file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. (default to 'pdf') # @return [File] def signature_request_files(signature_request_id, opts = {}) data, _status_code, _headers = signature_request_files_with_http_info(signature_request_id, opts) data end # Download Files # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a PDF or ZIP file. If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @option opts [String] :file_type Set to `pdf` for a single merged document or `zip` for a collection of individual documents. # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers def signature_request_files_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_files ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_files" end allowable_values = ["pdf", "zip"] if @api_client.config.client_side_validation && opts[:'file_type'] && !allowable_values.include?(opts[:'file_type']) fail ArgumentError, "invalid value for \"file_type\", must be one of #{allowable_values}" end # resource path local_var_path = '/signature_request/files/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'file_type'] = opts[:'file_type'] if !opts[:'file_type'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/pdf', 'application/zip', 'application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'File' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_files", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::File" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_files\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download Files as Data Uri # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @return [FileResponseDataUri] def signature_request_files_as_data_uri(signature_request_id, opts = {}) data, _status_code, _headers = signature_request_files_as_data_uri_with_http_info(signature_request_id, opts) data end # Download Files as Data Uri # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a `data_uri` representing the base64 encoded file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @return [Array<(FileResponseDataUri, Integer, Hash)>] FileResponseDataUri data, response status code and response headers def signature_request_files_as_data_uri_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_files_as_data_uri ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_files_as_data_uri" end # resource path local_var_path = '/signature_request/files_as_data_uri/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FileResponseDataUri' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_files_as_data_uri", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::FileResponseDataUri" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_files_as_data_uri\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download Files as File Url # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @return [FileResponse] def signature_request_files_as_file_url(signature_request_id, opts = {}) data, _status_code, _headers = signature_request_files_as_file_url_with_http_info(signature_request_id, opts) data end # Download Files as File Url # Obtain a copy of the current documents specified by the `signature_request_id` parameter. Returns a JSON object with a url to the file (PDFs only). If the files are currently being prepared, a status code of `409` will be returned instead. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @return [Array<(FileResponse, Integer, Hash)>] FileResponse data, response status code and response headers def signature_request_files_as_file_url_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_files_as_file_url ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_files_as_file_url" end # resource path local_var_path = '/signature_request/files_as_file_url/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'FileResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_files_as_file_url", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::FileResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_files_as_file_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Signature Request # Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_get(signature_request_id, opts = {}) data, _status_code, _headers = signature_request_get_with_http_info(signature_request_id, opts) data end # Get Signature Request # Returns the status of the SignatureRequest specified by the `signature_request_id` parameter. # @param signature_request_id [String] The id of the SignatureRequest to retrieve. # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_get_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_get ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_get" end # resource path local_var_path = '/signature_request/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Signature Requests # Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. # @param [Hash] opts the optional parameters # @option opts [String] :account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. # @option opts [Integer] :page Which page number of the SignatureRequest List to return. Defaults to `1`. (default to 1) # @option opts [Integer] :page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. (default to 20) # @option opts [String] :query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. # @return [SignatureRequestListResponse] def signature_request_list(opts = {}) data, _status_code, _headers = signature_request_list_with_http_info(opts) data end # List Signature Requests # Returns a list of SignatureRequests that you can access. This includes SignatureRequests you have sent as well as received, but not ones that you have been CCed on. Take a look at our [search guide](/api/reference/search/) to learn more about querying signature requests. # @param [Hash] opts the optional parameters # @option opts [String] :account_id Which account to return SignatureRequests for. Must be a team member. Use `all` to indicate all team members. Defaults to your account. # @option opts [Integer] :page Which page number of the SignatureRequest List to return. Defaults to `1`. # @option opts [Integer] :page_size Number of objects to be returned per page. Must be between `1` and `100`. Default is `20`. # @option opts [String] :query String that includes search terms and/or fields to be used to filter the SignatureRequest objects. # @return [Array<(SignatureRequestListResponse, Integer, Hash)>] SignatureRequestListResponse data, response status code and response headers def signature_request_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_list ...' end # resource path local_var_path = '/signature_request/list' # query parameters query_params = opts[:query_params] || {} query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SignatureRequestListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_list", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestListResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Release On-Hold Signature Request # Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. # @param signature_request_id [String] The id of the SignatureRequest to release. # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_release_hold(signature_request_id, opts = {}) data, _status_code, _headers = signature_request_release_hold_with_http_info(signature_request_id, opts) data end # Release On-Hold Signature Request # Releases a held SignatureRequest that was claimed and prepared from an [UnclaimedDraft](/api/reference/tag/Unclaimed-Draft). The owner of the Draft must indicate at Draft creation that the SignatureRequest created from the Draft should be held. Releasing the SignatureRequest will send requests to all signers. # @param signature_request_id [String] The id of the SignatureRequest to release. # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_release_hold_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_release_hold ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_release_hold" end # resource path local_var_path = '/signature_request/release_hold/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_release_hold", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_release_hold\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send Request Reminder # Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE**: This action can **not** be used with embedded signature requests. # @param signature_request_id [String] The id of the SignatureRequest to send a reminder for. # @param signature_request_remind_request [SignatureRequestRemindRequest] # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_remind(signature_request_id, signature_request_remind_request, opts = {}) data, _status_code, _headers = signature_request_remind_with_http_info(signature_request_id, signature_request_remind_request, opts) data end # Send Request Reminder # Sends an email to the signer reminding them to sign the signature request. You cannot send a reminder within 1 hour of the last reminder that was sent. This includes manual AND automatic reminders. **NOTE**: This action can **not** be used with embedded signature requests. # @param signature_request_id [String] The id of the SignatureRequest to send a reminder for. # @param signature_request_remind_request [SignatureRequestRemindRequest] # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_remind_with_http_info(signature_request_id, signature_request_remind_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_remind ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_remind" end # verify the required parameter 'signature_request_remind_request' is set if @api_client.config.client_side_validation && signature_request_remind_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_remind_request' when calling SignatureRequestApi.signature_request_remind" end # resource path local_var_path = '/signature_request/remind/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_remind_request, Dropbox::Sign::SignatureRequestRemindRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_remind", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_remind\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove Signature Request Access # Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. # @param signature_request_id [String] The id of the SignatureRequest to remove. # @param [Hash] opts the optional parameters # @return [nil] def signature_request_remove(signature_request_id, opts = {}) signature_request_remove_with_http_info(signature_request_id, opts) nil end # Remove Signature Request Access # Removes your access to a completed signature request. This action is **not reversible**. The signature request must be fully executed by all parties (signed or declined to sign). Other parties will continue to maintain access to the completed signature request document(s). Unlike /signature_request/cancel, this endpoint is synchronous and your access will be immediately removed. Upon successful removal, this endpoint will return a 200 OK response. # @param signature_request_id [String] The id of the SignatureRequest to remove. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def signature_request_remove_with_http_info(signature_request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_remove ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_remove" end # resource path local_var_path = '/signature_request/remove/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) post_body = {} form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['api_key'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_remove", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_remove\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send Signature Request # Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. # @param signature_request_send_request [SignatureRequestSendRequest] # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_send(signature_request_send_request, opts = {}) data, _status_code, _headers = signature_request_send_with_http_info(signature_request_send_request, opts) data end # Send Signature Request # Creates and sends a new SignatureRequest with the submitted documents. If `form_fields_per_document` is not specified, a signature page will be affixed where all signers will be required to add their signature, signifying their agreement to all contained documents. # @param signature_request_send_request [SignatureRequestSendRequest] # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_send_with_http_info(signature_request_send_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_send ...' end # verify the required parameter 'signature_request_send_request' is set if @api_client.config.client_side_validation && signature_request_send_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_send_request' when calling SignatureRequestApi.signature_request_send" end # resource path local_var_path = '/signature_request/send' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_send_request, Dropbox::Sign::SignatureRequestSendRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_send", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_send\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send with Template # Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. # @param signature_request_send_with_template_request [SignatureRequestSendWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_send_with_template(signature_request_send_with_template_request, opts = {}) data, _status_code, _headers = signature_request_send_with_template_with_http_info(signature_request_send_with_template_request, opts) data end # Send with Template # Creates and sends a new SignatureRequest based off of the Template(s) specified with the `template_ids` parameter. # @param signature_request_send_with_template_request [SignatureRequestSendWithTemplateRequest] # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_send_with_template_with_http_info(signature_request_send_with_template_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_send_with_template ...' end # verify the required parameter 'signature_request_send_with_template_request' is set if @api_client.config.client_side_validation && signature_request_send_with_template_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_send_with_template_request' when calling SignatureRequestApi.signature_request_send_with_template" end # resource path local_var_path = '/signature_request/send_with_template' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_send_with_template_request, Dropbox::Sign::SignatureRequestSendWithTemplateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_send_with_template", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_send_with_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Signature Request # Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE**: This action cannot be performed on a signature request with an appended signature page. # @param signature_request_id [String] The id of the SignatureRequest to update. # @param signature_request_update_request [SignatureRequestUpdateRequest] # @param [Hash] opts the optional parameters # @return [SignatureRequestGetResponse] def signature_request_update(signature_request_id, signature_request_update_request, opts = {}) data, _status_code, _headers = signature_request_update_with_http_info(signature_request_id, signature_request_update_request, opts) data end # Update Signature Request # Updates the email address and/or the name for a given signer on a signature request. You can listen for the `signature_request_email_bounce` event on your app or account to detect bounced emails, and respond with this method. Updating the email address of a signer will generate a new `signature_id` value. **NOTE**: This action cannot be performed on a signature request with an appended signature page. # @param signature_request_id [String] The id of the SignatureRequest to update. # @param signature_request_update_request [SignatureRequestUpdateRequest] # @param [Hash] opts the optional parameters # @return [Array<(SignatureRequestGetResponse, Integer, Hash)>] SignatureRequestGetResponse data, response status code and response headers def signature_request_update_with_http_info(signature_request_id, signature_request_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SignatureRequestApi.signature_request_update ...' end # verify the required parameter 'signature_request_id' is set if @api_client.config.client_side_validation && signature_request_id.nil? fail ArgumentError, "Missing the required parameter 'signature_request_id' when calling SignatureRequestApi.signature_request_update" end # verify the required parameter 'signature_request_update_request' is set if @api_client.config.client_side_validation && signature_request_update_request.nil? fail ArgumentError, "Missing the required parameter 'signature_request_update_request' when calling SignatureRequestApi.signature_request_update" end # resource path local_var_path = '/signature_request/update/{signature_request_id}'.sub('{' + 'signature_request_id' + '}', CGI.escape(signature_request_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end post_body = {} form_params = opts[:form_params] || {} result = @api_client.generate_form_data( signature_request_update_request, Dropbox::Sign::SignatureRequestUpdateRequest.openapi_types ) # form parameters if result[:has_file] form_params = opts[:form_params] || result[:params] header_params['Content-Type'] = 'multipart/form-data' else # http body (model) post_body = opts[:debug_body] || result[:params] end # return_type return_type = opts[:debug_return_type] || 'SignatureRequestGetResponse' # auth_names auth_names = opts[:debug_auth_names] || ['api_key', 'oauth2'] new_options = opts.merge( :operation => :"SignatureRequestApi.signature_request_update", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e if e.code === 200 body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::SignatureRequestGetResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i if e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" ) fail ApiError.new(:code => e.code, :response_headers => e.response_headers, :response_body => body), e.message end end if @api_client.config.debugging @api_client.config.logger.debug "API called: SignatureRequestApi#signature_request_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end