Good Practices?

Options

Hi all,

I'm running into a delimma on Authorization code and refresh token for calling SKY API.

Problem: I want to be able to call any SKY API from Power Automate, either if I'm testing code, or for production use in administration (i.e. registering webhook; getting list of webhooks; listing attributes; listing tableentries). Previously, I use Postman to get an authorization token, which only last 60 minutes whenever I need to make a call. I find it very inconvenience. Then I saw refresh token….

So what I did:

  • I created a SharePoint List, that ONLY I have access to. It stores various information for API use: subscription key, application id/secret, auth token, refresh token
    • I populated the auth token and refresh token with what I got from Postman
  • I created a Power Automate that calls the refresh token API every 58 minutes to get a new auth token and new refresh token to update into the SharePoint List

Now on all my flow, I can get the subscription key and auth token from the SharePoint List and do SKY API using them.

Does anyone see a problem with this method? Anyone has any other solution to my problem?

Categories