/messages (v2)

Send a message to a company 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::Post.new(url)
request['Authorization'] = "Bearer <OAUTH_TOKEN>"
request['Content-Type']  = 'application/json'
params = {
  :sender_id 		=> 12345,
  :receiver_ids => [67890],
  :body => "Hi, this is a test message"
}
request.body = params.to_json

response = http.request(request)
puts response.read_body
Language
Authorization
Header
Click Try It! to start a request and see the response here!