Research API - refresh credentials 5 min before expiration

Research API user guide 2.0, page 17 says:

"Note: Cloud credentials are active for one hour; please refresh the credentials five minutes before the expiration."

Is there any sample code available for the process?

Best Answer

  • Gurpreet
    Gurpreet admin
    Answer ✓
    If “Atexit.register(removeSubscription)” is deleted from “startResearchAlerts() sample, currentSubscriptionID returned by “subscribeToResearch” is always the same? In other words, is it not necessary to change the below part to get current subscription ID? If yes, please advise how to change.

    Your application will have to store the subscription parameters from existing subscription and skip the SubscribeToResearch() function. Calling this function again, will create a new subscription for the application - which is not what you want. At some point new subscriptions will be denied as well.

Answers