Method: Gupshup::Enterprise#bulk_file_upload

Defined in:
lib/parity-gupshup.rb

#bulk_file_upload(file_path, file_type = 'csv', mime_type = 'text/csv', opts = {}) ⇒ Object



110
111
112
113
114
115
116
117
118
119
# File 'lib/parity-gupshup.rb', line 110

def bulk_file_upload(file_path,file_type = 'csv',mime_type = 'text/csv', opts = {})
  msg_params = {}
  msg_params[:method] = 'xlsUpload'
  msg_params[:filetype] = file_type.to_s
  file = File.new(file_path,"r")
  def file.mime_type; "text/csv"; end
  msg_params[:xlsFile] = file
  resp = HTTPClient.post(@api_url,msg_params.merge(@api_params).merge(opts))
  file.close
end