Register User Device - Ruby

Source Code:

  

require 'uri'
require 'net/http'

url = URI("https://send.pushnotificationapi.com/v1/device/add")

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&device_token=YOUR-DEVICE-TOKEN&platform=YOUR-PLATFORM&user_id=OPTIONAL-USER-ID&tag=OPTIONAL-TAG"

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