Module: SpeechCloud::Auth
- Defined in:
- lib/speechcloud/authorization.rb
Class Method Summary collapse
-
.check_token(token) ⇒ Object
Verify that token and md5 are legit.
-
.get_token ⇒ Object
Make a request for a token.
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_token ⇒ Object
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 = { :body => "email=#{email}" } HTTParty.post("#{BASE_URL}/tokens/", ) end |