post https://api.keeptruckin.com/v1/fuel_purchase_imports
Upload fuel purchases through CSV
You can also use the Motive Template
# using source ‘efs-integration’ for EFS cards only.
require 'uri'
require 'net/http'
require 'json'
url = URI('https://api.keeptruckin.com/v1/fuel_purchase_imports')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type'] = 'application/json'
params = {
:source => 'efs-integration',
:import => ["file_name.csv","base64_encoded_csv"]
}
request.body = params.to_json
response = http.request(request)
puts response.read_body