0

According to this documentation

The lifetime of an access token is 20 minutes.

They've also mentioned these considerations

Follow these considerations when using the API directly and doing your own OAuth token management.

  1. Do not request a new access token for every API call you make—-each access token is good for 20 minutes and is reusable. Making two API calls for every one operation is inefficient and causes throttling. Be careful where you store your client ID and secret.
  2. Never expose this information on the client side via JavaScript or store it in a mobile application. Ensure that these credentials are stored securely in your application.

What workarounds/temp solutions are there for increasing lifespan? Better yet, a more permanent solution to this?

The reason why we need Access token to be longer than 20 mins is because processing huge amounts of data could like take LONGER than 20 minutes and we have to waste 1 more API call every 20 minutes (meaning 72 API calls per day just because of this)

6
  • 2
    This sounds more like an XY problem. You should consider if this integration approach is the best way to solve your data processing requirement. 72 API calls for auth, means you basically are authenticated 24/7. This is an approach I have never seen before, and would never recommend. Commented Sep 14, 2021 at 7:55
  • That was just an example to highlight many wasted API calls. My intent was more if data processing take longer than 20 mins can we at least have it authenticated for an hour?
    – compski
    Commented Sep 14, 2021 at 8:13
  • 1
    Unfortnately, it is not possible to extend the lifetime of the Oauth token in SFMC, so you need to refresh it every 19 minutes and 59 seconds. Commented Sep 14, 2021 at 8:23
  • 2
    I would recommend using file drops and imports to process data which is taking the api 20+ mins
    – EazyE
    Commented Sep 14, 2021 at 12:23
  • 1
    For security reasons alone, I would say trying to go above 20 mins is a bad idea. Any process that you have that goes beyond 20 mins straight should either be adjusted to import via FTP similar to what EazyE said or needs to otherwise be optimized. SFMC is not made nor optimized for those kinds of API transactions, so you would be introducing great risk and great amount of processing to the system that can slow down everything else you are doing. Here is a great way to optimize your token usage: (ampscript.xyz/tips-and-tricks/…) Commented Sep 14, 2021 at 13:17

0

You must log in to answer this question.

Browse other questions tagged .