-
Notifications
You must be signed in to change notification settings - Fork 0
Obtaining access‐token
Since 1.0.1 you can obtain an access-token through the plugin command, which will greatly simplify your life.
This guide walks you through the process of obtaining an access token for DonationAlerts and connecting the plugin to your account.
If you already have a valid access token, you can simply place it in the config.yml file and run /daapi reload.
- A DonationAlerts account
- Your Minecraft server running with the plugin installed
- Access to the server console or operator permissions
First, you need to register an OAuth2 application on DonationAlerts.
- Go to DonationAlerts Applications.
- Click Create new app.
- Fill in the form:
- App name - any name you like (e.g., MyMinecraftPlugin).
-
Redirect URL - exactly as specified in your plugin's config.yml. (By default, it's
http://localhost:8080/callback, but you can change it if needed.)
- Click CREATE
After creation, you will see your App ID and API Key (also called Client Secret).
Open your config.yml file and fill in the following fields:
access-token: "" # leave empty for now
client-id: "YOUR_APP_ID"
client-secret: "YOUR_API_KEY"-
client-id– paste the App ID from your DonationAlerts application. -
client-secret– paste the API Key (Client Secret).
! Never share your
client-secretoraccess-tokenwith anyone. After saving the file, reload the plugin:
/daapi reloadNow you need to generate a one‑time authorization code.
- In-game or in the console, run:
/daapi auth
- The plugin will display a clickable URL in the chat (or console).
- You will be redirected to DonationAlerts.
- After granting access, you will be redirected to the Redirect URL you set earlier.
- Copy that entire code - it is your temporary authorization code.
! The authorization code is short‑lived. If it expires, you must repeat this step.
Now exchange the authorization code for a permanent access token.
- In the server console (or in-game with operator permissions), run:
daapi token YOUR_AUTHORIZATION_CODE(Replace YOUR_AUTHORIZATION_CODE with the actual code you copied.)
- The plugin will exchange the code for an access token, automatically save it to your
config.yml, and establish a connection.
- Verify the connection:
/daapi status
You should see:
Your access token is now stored in
config.yml. Never share it or commit it to version control.
[ERROR] [DonationAlertsAPI] Token exchange error (response 400):
{"error":"invalid_request","error_description":"The request is missing ...","hint":"Authorization code has expired"}
Cause: The temporary code you used expired (it's valid for ~10 minutes). Fix: Repeat Step 3 and Step 4 to get a fresh code.
Getting Started
Advanced usage