Skip to content

Instantly share code, notes, and snippets.

@pboos
Forked from codebutler/crashlytics_orgs.rb
Created July 18, 2013 01:51
Show Gist options
  • Save pboos/6026121 to your computer and use it in GitHub Desktop.
Save pboos/6026121 to your computer and use it in GitHub Desktop.
require 'httparty'
require 'json'
class Crashlytics
include HTTParty
base_uri 'https://api.crashlytics.com/api/v2'
def session(email, password)
self.class.post('/session.json',
body: {email: email, password:password}.to_json,
headers: {
'X-CRASHLYTICS-DEVELOPER-TOKEN' => 'ed8fc3dc68a7475cc970eb1e9c0cb6603b0a3ea2',
'Content-Type' => 'application/json'
}
)
end
end
c = Crashlytics.new
session = c.session('YOUR_EMAIL', 'YOUR_PASSWORD')
session['organizations'].each do |org|
puts org['name']
puts org['api_key']
puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment