Method: Libring::API#get_message
- Defined in:
- lib/libring/api.rb
#get_message(contact_code) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/libring/api.rb', line 95 def (contact_code) require "net/https" require "uri" require "json" uri = URI.parse("https://api.libring.com/v2/messages/get/" + contact_code.to_s) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true req = Net::HTTP::Get.new(uri.request_uri, initheader = {'Content-Type' =>'application/json', 'Authorization' => "Token #{@token}"}) resp = https.request(req) resp.body end |