Refreshing bearers token without app

I have a python script i use to just GET data. I have not created an application, instead I just use the bearer token and my Sub Key.

Now obviously those bearer tokens end in 60 minutes. I know that you can refresh with an app and using the refresh token.

Is there anyway I can automate getting a new bearer token without having an application and also having no to minimal manual work?

I'd love my python script to be able to generate a new token, and then use that to get the data. Does anyone know how to do this? or an option that atleast prints out the token for me to paste it in the hdr

Comments

  • Hey @Hamish Burnett, this is a set up I use when I'm working with the api locally. I just use a Jupyter notebook to exchange the refresh token.


  • @Matt Thacker
    May just not be my day. What is my client ID if i don't have an application? I have tried my username, email etc.

    Going through my account, whilst i can find my subscription key (which i assume i use as my client secret) I cant find my ID

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 Raiser's Edge NXT Fall 2025 Product Update Briefing Badge

    @Hamish Burnett
    client_id and client_secret has nothing to do with your username and password.

    You need an Application created in developer.blackbaud.com as client_id and client_secret is associated with an Application.

  • @Alex Wong
    Ugh I knew it. Anyway to do this refresh token etc without an application?

  • Alex Wong
    Alex Wong Community All-Star
    Ninth Anniversary Kudos 5 Facilitator 3 Raiser's Edge NXT Fall 2025 Product Update Briefing Badge
  • @Hamish Burnett Don't get me started on oAuth 2(!), but to provide some actual useful information, do a search of the Community for Headless, Authentication, Authorization, oAuth, etc and you'll find quite a few posts which might help you.

    If you have access to Visual Studio (eg Community Edition, free if you're not using it for profit), you can use our SKYLib•NET demo apps (C# and VB) as Authorization apps. Just plug in your keys, etc and the app will do the auth for you and save the tokens in an XML file from where you can put them wherever you like for consumption by your script(s).

    Note to self: I should make a freebie stand-along app just for this!

    Cheers,

    Steve Cinquegrana | CEO and Principal Developer | Protégé Solutions

  • @Hamish Burnett
    setting the application up takes no work.

    I have this class you can import into your .py to authenticate. Initially it will notice you need an access_token, it will use a temp local server giving you a localhost link to sign in with a BBID that has access. Then it will automatically, exchange a refresh token for a new access token.

    you will also need to pip install keyring to secure your keys/tokens.