Skip to content

Instantly share code, notes, and snippets.

@nikclayton
Created April 15, 2025 19:13
Show Gist options
  • Save nikclayton/d1c39bbaa42a2951f4c60a03580a6665 to your computer and use it in GitHub Desktop.
Save nikclayton/d1c39bbaa42a2951f4c60a03580a6665 to your computer and use it in GitHub Desktop.

Step 1. Get your authorization token

  1. Open your account in the browser (i.e., open https://hachyderm.io and make sure you're logged in).

  2. Open the inspector (Firefox: https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/open_the_inspector/index.html, Chrome: https://firefox-source-docs.mozilla.org/devtools-user/page_inspector/how_to/open_the_inspector/index.html, Safari: https://developer.apple.com/documentation/safari-developer-tools/inspecting-safari-macos, then https://developer.apple.com/documentation/safari-developer-tools/web-inspector).

  3. Make sure the inspector is showing network requests

  4. Reload the page (Ctrl-R). This should trigger a notification fetch.

  5. In the network inspector select the request for home (in the "File" column -- you can filter to just "XHR" requests at the top of the inspector to limit the number of entries you need to look at) with a "200" status response.

  6. In the inspector's "Headers" panel is a subsection, "Request Headers".

  7. In that section, look for the entry that starts "Authorization:". It will be followed by Bearer , and then a string of characters. This is the token we need.

Step 2. Make the request, process the results

(assumes a Unix-like environment with curl and jq installed)

  1. Set the token as an environment variables
export TOKEN=<string of characters from step 1.8>
  1. Make the request.
curl -s -H "Authorization: Bearer $TOKEN" "https://hachyderm.io/api/v1/notifications?include_filtered=true&limit=90"" | jq > out.json

Step 3. Redact the response

  1. Use jq to redact the notifications

I'm only interested in moderator / admin related notifications, since those are the ones I can't trivially generate myself. To generate the redacted list run this:

jq -c 'map(select(.type == "admin.sign_up" or .type == "admin.report" or .type == "severed_relationships" or .type == "moderation_warning"))' < out.json | jq > filtered.json

That will filter the notifications to just admin/moderator related types (the list of types is at https://docs.joinmastodon.org/entities/Notification/#type).

  1. (optional) review and perform further redaction

You may want to further redact the contents of filtered.json.

It shouldn't contain any content from yours or anyone else posts.

It will contain information about accounts referenced in those notifications, and the IDs of different statuses referenced in those notifications.

You can do that by hand editing the JSON if absolutely necessary. Obviously, the more hand editing you do the greater the risk of inadvertently corrupting the file.

Step 4. Send JSON

Do not attach this to a GitHub issue

E-mail redacted.json to [email protected]. The data will be treated as confidential, and deleted when debugging is complete.

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