Sky API Authorization

Hello,


I am trying to write a python program to poll the School API.


I am using the following test page which works great when I choose Authorization key in the Blackbaud OAuth 2.0 Service section. The problem is that key expires in an hour. same with the Implicit option. Selection No Auth option triggers an error. 

https://developer.sky.blackbaud.com/docs/services/school/operations/v1levelsget/console


How do I hand this rolling Authorization key in my program, any advice or help to point me in the right direction would be extremely helpful. Thank you!


Chris Behar


 

Comments

  • Hi Chris‍ ,


    You might want to do a Community search on "Authorization" or "Token"; there're plenty of posts about this topic, I can assure you.


    In summary, you need to ensure that your Access Token is refreshed every 60 minutes if you're running an on-going process. If you're only intermittently making calls you'll need to refresh it before making calls if it has expired. You use the Refresh Token to get a new Access Token and, usually, a new Refresh Token, though you can persist the RT for up to a year if you have distributed apps, say, and don't want tokens to get out of sync. Generally, though, I'd stick to the default of a new RT per AT.


    I assume that you've devoured the documentation on this topic so, cutting to the chase, you can either monitor your AT's life or simply refresh it on a call error and retry the call. The latter is somewhat better (IMHO) as it lets you also trap problems with lost/corrupt tokens, server outages/maintenance, etc, etc. And you will need to handle these if you want your app to be robust. Unfortunately, at times it can be difficult to determine the actual reason for non-response as the APIs are a little bit too keen on chucking the dreaded tells-you-nothing 500 Internal Server Error at you when they perhaps should not.


    Have a read through this post as well where, near the end, I mention using our SKYLib.NET code library demo apps as a sanity check during your development (or perhaps in lieu of it).


    I hope that helps.


    Cheers,

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

     

  • Hi Steven,



    Thanks for this... We
    actually worked something out and are storing the token temporarily
    just in case the application needs a restart. We actually worked
    through this and have the authentication working really 
    well. 



    I'm going to CC Blake our
    developer. I think he has a handle on everything but he might have
    some questions. 



    Overall the skyAPI is
    great. One question, why can't we get Calendar events from the
    School API? Right now the only way to get it is via the RSS/Webcal
    feed. Can we put this in as a feature request? Getting the calendar
    via API seems so much more reliable than what we have to do
    now.



    Thanks again Steven!



    --

    Chris Behar 
    Network/Systems Engineer 






    uc?id=0B1uE2khR5skPSHphZW5KTTYwSU0

    Francis Parker School
      San Diego,
    CA

    www.francisparker.org | @francisparkersc | facebook.com/francisparkerschool


    As Far As The Mind Can See

  • Bryna Gleich
    Bryna Gleich Blackbaud Employee
    Tenth Anniversary Kudos 3 Name Dropper Participant

    One question, why can't we get Calendar events from the School API? Right now the only way to get it is via the RSS/Webcal feed. Can we put this in as a feature request? Getting the calendar via API seems so much more reliable than what we have to do now.



    To request a feature, post your idea to https://developer.blackbaud.com/skyapi/support/ideas in the "School API" category. Be sure to explain why and how you'd like to use it, so the idea has good context.


    You can see the ideas other people have posted, up vote ideas you agree with, and add comments to other ideas too. 


    Product managers monitor the ideas. They may ask for more information and respond with information about future product road maps.

Categories