Python API Credentials Connector Library

This is intended to help anyone who may find this useful. I wanted to write an internal Python application to sync my Blackbaud database with my LDAP server, and I found getting authenticated to be a large hurdle to overcome. I have open-sourced a connector under GPL-v3 that anyone can feel free to use.

https://github.com/justein230/BbApiConnector-Python


Let me know if you have any changes I should make! Open to all improvements.

Comments

  • Justin,


    Nicely done and thank you! I've been building some custom connectors for Power Automate and Power BI - I didn't realize you could roll your own with Python. You probably already know this, but the Legacy List call is also a nifty way to extract just the data you need from the School API as opposed to your entire ocean of SKY data as the API will return only the records in the Advanced List as well as the data and headings you establish in the product. So, you could make an advanced list of just your "active users" with the exact output needed to populate LDAP, call that list via the Legacy List endpoint and then push the JSON data into a CSV file for importing into LDAP -- or -- if you are braver than I, push the JSON directly into the LDAP.


    If you don't know Shandor Simon‍ you should. He has done similar work with the API and Powershell. 

    Shandor Simon‍ , Justin Stein‍ 


    Again, nice work!


    Cheers,


    -graham
  • Hi Graham,


    Thanks for the kind words. I was not aware of the Legacy list option - it looks like in order to use it properly, you need a "list ID". Not really familiar with where I would find a list of list IDs. Am I looking in the wrong place?


    Thanks,

    Justin
  • Hi Justin,


    You can find out the list ID by hovering over the "Run" link for an existing advanced list.


    This is one of my advanced lists in Blackbaud K-12:

    34912cbe7941ba0c10480f3ba943d569-huge-li


    The part after ~slid= is what you need to take note of for your own advanced list.


    For example:
    https://api.sky.blackbaud.com/school/v1/legacy/lists/95827


    Note that the HTTP response will be formatted as application/json. You'll need to reformat it to be application/csv to match what you get if you were to run the advanced list directly.


    Matt
  • Thanks for posting this. I haven't had the chance yet to check out the code to see if there's anything in there that I can use in my own project, but you may want to look at the Python package that I built for accessing ON API and SKY API endpoints. https://github.com/Lugal-PCZ/bbapi_toolkit