Skip to content

Instantly share code, notes, and snippets.

@codebutler
Last active April 10, 2022 07:32
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save codebutler/5763818 to your computer and use it in GitHub Desktop.
Save codebutler/5763818 to your computer and use it in GitHub Desktop.
Crashlytics requires an IDE to "onboard" an Android app for no good reason. This prevents you from setting up a new app using a command line build tools such as Maven, Gradle or unsupported IDEs such as Android Studio. Turns out all you really need is your org's api key, which you can get using this script. Then just add this to your AndroidMani…
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
@z0mt3c
Copy link

z0mt3c commented Jul 30, 2013

Thanks - or just a way more simple:

 curl --header "Content-Type: application/json" --header "X-CRASHLYTICS-DEVELOPER-TOKEN: ed8fc3dc68a7475cc970eb1e9c0cb6603b0a3ea2" --data "{\"email\":\"XXX\",\"password\":\"XXX\"}" https://api.crashlytics.com/api/v2/session.json

@stanch
Copy link

stanch commented Aug 1, 2014

Thanks a lot! Even simpler with httpie:

http https://api.crashlytics.com/api/v2/session.json X-CRASHLYTICS-DEVELOPER-TOKEN:ed8fc3dc68a7475cc970eb1e9c0cb6603b0a3ea2 email=XXX password=XXX

@jaredsburrows
Copy link

@codebutler @z0mt3c How can I get my "API secret" from this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment