С помощью @kiddorails мне удалось ее решить.
Вот решение:
Сначала отредактируйте исходный код в этом формате.Основная идея состоит в том, чтобы изменить Content-Type на 'text / csv' и ввести строку в тело.
def update_recipients_with_http_info(account_id, envelope_id, recipient_id, bulk_recipients_request)
if @api_client.config.debugging
@api_client.config.logger.debug "Calling API: BulkEnvelopesApi.update_recipients ..."
end
# verify the required parameter 'account_id' is set
fail ArgumentError, "Missing the required parameter 'account_id' when calling BulkEnvelopesApi.update_recipients" if account_id.nil?
# verify the required parameter 'envelope_id' is set
fail ArgumentError, "Missing the required parameter 'envelope_id' when calling BulkEnvelopesApi.update_recipients" if envelope_id.nil?
# verify the required parameter 'recipient_id' is set
fail ArgumentError, "Missing the required parameter 'recipient_id' when calling BulkEnvelopesApi.update_recipients" if recipient_id.nil?
# resource path
local_var_path = "/v2/accounts/{accountId}/envelopes/{envelopeId}/recipients/{recipientId}/bulk_recipients".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s).sub('{' + 'envelopeId' + '}', envelope_id.to_s).sub('{' + 'recipientId' + '}', recipient_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'])
header_params['Content-Type'] = 'text/csv'
# form parameters
form_params = {}
# http body (model)
# post_body = @api_client.object_to_http_body(bulk_recipients_request)
# puts bulk_recipients_request
# post_body = body_params
auth_names = []
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
:header_params => header_params,
:query_params => query_params,
:form_params => form_params,
:body => bulk_recipients_request,
:auth_names => auth_names,
:return_type => 'BulkRecipientsSummaryResponse')
if @api_client.config.debugging
@api_client.config.logger.debug "API called: BulkEnvelopesApi#update_recipients\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
end
return data, status_code, headers
end
end
Во-вторых, установите bulk_recipients_request как строку (с символами новой строки для каждой строки данных)
"rowNumber,email,name,Accesscode\n"+"1,berry@gmail.com,Berry,11223\n"