Trying to refresh creator token in java


#1

Okay, so, I have a bot for discord that uses the patreon API to give bot related perks to users that are supporting me on patreon.

I’m using Java to develop this bot and I am using the Java Library for the API.

The Java Lib does not have support for refreshing the creator token which I need to do so every month I don’t have to go and refresh the token to allow my patrons to get access to their perks. right now I have a workaround that allows me to manually refresh the token but I would prefer to have it automatically update.

I Have attempted to write my own POST request to attempt to refresh the token but as I’m just using the access token to connect and not using OAuth to log in it appears that I can’t do this

Here is the code I have written to attempt to refresh the token to no avail.
https://pastebin.com/X9k94VsF

If I could get some help figuring out what to do that would be great.


#2

Hey there! How are often are you making refresh requests? What’s the error you get back?


#3

in testing every time I start the bot, in actuality, it should only run if the token provided by the user is invalid by time or just a broken token

as for the error, i get? the code doesn’t seem to have a response code so to my understanding it isn’t actually sending the POST request and I don’t know what I need to do codewise to actually send the request properly.