School API authorizing without browser interaction

Hi Guys,

I'm working on pulling advanced lists from BBK12 through School API. I want it to perform nighly automatically. Are there any good ideas to get the access token without clicking the “Authorize” on the pop-up page, so that the script can update the authorization and pull the lists of data automatically?

Comments

  • Michael Tims
    Michael Tims Blackbaud Employee
    Sixth Anniversary Kudos 2 Name Dropper Participant

    Hi Jacob, the idea would be to authorize using the authorization code flow where you are presented with the consent form UI just once, and from that point forward you use the refresh token to acquire new access tokens. Using refresh tokens this way will allow you to continue to make API calls in your script (continue to generate access tokens) without the need to “Authorize” in the UI again.

    The Headless Data Sync app provides an example of how to pass an initial refresh token to an app/script, and then use that refresh token to generate a new access token after the access token expired.

    Hope that helps!

  • Jacob Dong
    Jacob Dong New Member
    Third Anniversary Kudos 1 Name Dropper Facilitator 1

    Thanks Michael! This helps a lot?. I'll check it out.

  • If you're a python developer you can use my sky-api client library. I have a method for pulling advanced list.

  • Jacob Dong
    Jacob Dong New Member
    Third Anniversary Kudos 1 Name Dropper Facilitator 1

    Thank you so much, warren, for letting me know your library. I'll definitely check it out and have some study in it. I guess it'll help me pretty much. ?

Categories