Method: TXTextControl::ReportingCloud::ReportingCloud#get_api_keys

Defined in:
lib/txtextcontrol/reportingcloud/reportingcloud.rb

#get_api_keysArray<String>

Returns all available API Keys of the current account.

Returns:

  • (Array<String>)

    All available API Keys of the current account.



481
482
483
484
485
486
487
488
489
490
491
492
493
# File 'lib/txtextcontrol/reportingcloud/reportingcloud.rb', line 481

def get_api_keys 
  res = request("/account/apikeys", :get)
  if res.kind_of? Net::HTTPSuccess
    keys = Array.new
    data = JSON.parse(res.body, object_class: OpenStruct)
    data.each do |elem|
      keys.push(APIKey.new(elem.key, elem.active))
    end
    return keys
  else
    raise res.body
  end        
end