Send Push Notification to User Devices - Ruby

Source Code:

  

require 'uri'
require 'net/http'

url = URI("https://send.pushnotificationapi.com/v1/push/send_by_userid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/x-www-form-urlencoded'
request["cache-control"] = 'no-cache'
request.body = "api_key=YOUR-API-KEY&user_id=YOUR-CUSTOM-USER-ID&msg_title=test%20message&destination_url=https%3A%2F%2Fpushnotificationapi.com"

response = http.request(request)
puts response.read_body