Trying to refresh creator token in java

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.

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

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

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.

I ended up having to create a request to oauth to get the refresh token working which I wasn’t sure if it would work or not, i wasnt sure how to set one up for a creator account but i just left the redirect url to be empty and it worked fine, i wish there was better documentation to explain that for users just using the Creator’s Access token to access the API

Hey Dawn,
Thanks for surfacing this. We’re going to make a pass on our docs very soon and will include this feedback.