Module: SpeechCloud::Auth

Defined in:
lib/speechcloud/authorization.rb

Class Method Summary collapse

Class Method Details

.check_token(token) ⇒ Object

Verify that token and md5 are legit. A response of 1 confirms that they are.



13
14
15
16
# File 'lib/speechcloud/authorization.rb', line 13

def check_token(token)
  params = "token=#{token}&md5=#{SpeechCloud::GetMd5.formula(token)}"
  HTTParty.get("#{BASE_URL}/tokens?#{params}")
end

.get_tokenObject

Make a request for a token



6
7
8
9
10
# File 'lib/speechcloud/authorization.rb', line 6

def get_token
  email = SpeechCloud::Config.email
  options = { :body => "email=#{email}" }
  HTTParty.post("#{BASE_URL}/tokens/", options)
end