The Community is hosting an End of Summer sweepstakes! Participants must complete tasks to earn tickets that will enter them with a chance to win a free year of Constant Contact and other great prizes!*
*No Purchase Necessary. For Official Rules, visit here. Constant Contact’s End of Summer 2020 Sweepstakes ends on October, 20, 2020 at 11:50 PM EST.

v3.0 What is the best practice for refreshing access tokens?

SOLVED
Go to solution
Highlighted
Occasional Contributor

v3.0 What is the best practice for refreshing access tokens?

What is the best practice for refreshing access tokens?

 

Do I wait until an error is generated?

Do I refresh based on age of access token?

Is it bad to refresh the token before every request?

 

Thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: v3.0 What is the best practice for refreshing access tokens?

Hello @DanH069,

 

Thank you for reaching out to Constant Contact's API Support.

 

I would suggest one of the first two options. I personally like to go with option two. I create two timers; one of the timers is set for two hours and the other is set for 24 hours. The two hour timer is reset any time I make an API call. If either timer reaches its end then I will go through the refresh process.


Regards,
Jimmy D.
Tier II API Support Engineer

View solution in original post

3 REPLIES 3
Highlighted
Moderator

Re: v3.0 What is the best practice for refreshing access tokens?

Hello @DanH069,

 

Thank you for reaching out to Constant Contact's API Support.

 

I would suggest one of the first two options. I personally like to go with option two. I create two timers; one of the timers is set for two hours and the other is set for 24 hours. The two hour timer is reset any time I make an API call. If either timer reaches its end then I will go through the refresh process.


Regards,
Jimmy D.
Tier II API Support Engineer

View solution in original post

Highlighted
Occasional Contributor

Re: v3.0 What is the best practice for refreshing access tokens?

Can you explain the problem with option 3? Other than potentially hitting a rate limit (which for my application will not happen), what is wrong with refreshing before every request?

Highlighted
Moderator

Re: v3.0 What is the best practice for refreshing access tokens?

Hi @JulieK7237,

 

Option 3's only down side really is the rate limit. If that is not an issue with your integration then feel free to use it.


Regards,
Jimmy D.
Tier II API Support Engineer
Developer Portal

View API documentation, code samples, get your API key.

Visit Page

Constant Contact 2020 End of Summer Community Sweepstakes!

The Constant Contact User Community is hosting a sweepstakes. The more you participate, the more chances you have to win! Read on to learn more...

Read More
Featured