Last active
May 5, 2022 17:42
-
-
Save ivansnag/5b740c2a57b6178d0f7c8468e62370db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of pulling audit entries | |
# Required: the auth token must be associated with an Organization Administrator on the account | |
require 'httparty' | |
require 'json' | |
@auth_token = "[YOUR AUTH TOKEN]" | |
@get_organizations_url= "https://api.bugsnag.com/user/organizations?admin=&per_page=10" | |
org_response = HTTParty.get(@get_organizations_url, | |
:headers => { 'Authorization' => "token #{@auth_token}",'Content-Type' => 'application/json', } | |
) | |
organization_id = org_response[0]['id'] | |
@list_audit_entries_url = "https://api.bugsnag.com/organizations/#{organization_id}/audit_entries?per_page=20" | |
audit_entries_request = HTTParty.get(@list_audit_entries_url, | |
:headers => { 'Authorization' => "token #{@auth_token}",'Content-Type' => 'application/json', } | |
) | |
puts audit_entries_request |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment