Module: Echowrap::API::Oauth

Includes:
Utils
Included in:
Client
Defined in:
lib/echowrap/api/oauth.rb

Constant Summary

Constants included from Utils

Utils::API_KEY_CANNOT_CALL_THIS_METHOD, Utils::INVALID_PARAMETER, Utils::MISSING_OR_INVALID_KEY, Utils::MISSING_PARAMETER, Utils::RATE_LIMIT_EXCEEDED, Utils::SUCCESS

Instance Method Summary collapse

Instance Method Details

#oauth_timestamp(options = {}) ⇒ Integer

Returns the current time of The Echo Nest API server. This time can be used to synchronize the local time with The Echo Nest allowing you to set a proper timestamp used generate authenticated requests to the API. This call returns the number of seconds elapsed since midnight, 1 January 1970.

Examples:

Return integer timestamp

Echowrap.oauth_timestamp

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Returns:

  • (Integer)
  • (Integer)

Raises:

See Also:



18
19
20
21
# File 'lib/echowrap/api/oauth.rb', line 18

def oauth_timestamp(options={})
  response = send(:get, '/api/v4/oauth/timestamp', options)
  response[:body][:response][:current_time]
end