class InContact::Tokens

Public Class Methods

get() click to toggle source
# File lib/incontact/tokens.rb, line 7
def get
  Connection.new(url, authorization, token_options).post(path, token_request_data)
end

Private Class Methods

auth_string() click to toggle source
# File lib/incontact/tokens.rb, line 40
def auth_string
  "#{ENV["INCONTACT_APP_NAME"]}@#{ENV["INCONTACT_VENDOR_NAME"]}:#{ENV["INCONTACT_BUSINESS_UNIT_NUMBER"]}"
end
authorization() click to toggle source
# File lib/incontact/tokens.rb, line 36
def authorization
  "basic #{encoded_auth_string}"
end
encoded_auth_string() click to toggle source
# File lib/incontact/tokens.rb, line 44
def encoded_auth_string
  Base64.encode64(auth_string).chomp
end
path() click to toggle source
# File lib/incontact/tokens.rb, line 17
def path
  ""
end
token_options() click to toggle source
# File lib/incontact/tokens.rb, line 30
def token_options
  {
    default_data_model: InContact::Models::Token
  }
end
token_request_data() click to toggle source
# File lib/incontact/tokens.rb, line 21
def token_request_data
  {
    grant_type: "password",
    username:   ENV["INCONTACT_USERNAME"],
    password:   ENV["INCONTACT_PASSWORD"],
    scope:      ENV["INCONTACT_SCOPE"]
  }
end
url() click to toggle source
# File lib/incontact/tokens.rb, line 13
def url
  ENV["INCONTACT_TOKEN_URL"]
end