get https://api.keeptruckin.com/v2/messages
List messages of the system user.
require 'uri'
require 'net/http'
require 'json'
url = URI('https://api.keeptruckin.com/v2/messages')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type'] = 'application/json'
params = {
:sender_id => 1645,
:receiver_ids => [1591],
}
request.body = params.to_json
response = http.request(request)
puts response.read_body