cancel
Showing results for 
Search instead for 
Did you mean: 
In recognition of Martin Luther King Day, our Support Centers will be open with limited hours on Monday (1/20) from 10AM ET to 6PM ET.
Visit our Help Center to see all of the ways you can find answers to your questions.

Refresh token strangeness

SOLVED
Highlighted
Occasional Advisor

Refresh token strangeness

I am using server flow to authenticate a batch process.  I successfully exchange the authorization code for an Access Token and Refresh token (step 4) of the documented process.

 

Next, I have a loop (as I am still in an early debug stage) where I refresh my token 5 times - just to see if it works.  The first 4 responses include 'access_token', 'refresh_token', and 'token_type'.  The 5th call, however, only returns an 'access_token' and a 'token_type'.

 

Why am I getting this strange (to me, at least) response?  I'd expect it to look like the previous 4 - which included a 'refresh_token'.

Tags (1)
2 REPLIES 2
Moderator

Re: Refresh token strangeness

Hello @FirstNameL86527,

 

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

 

I would expect all of the responses to have the same format, of course with different values for the tokens. The only thing I could see that might be an issue is if you hit a rate limit which would give you a different error.

 

How quickly did you make your five requests and have you tried again and gotten the same, or a different response?


Regards,
Jimmy D.
Tier II API Support Engineer
Occasional Advisor

Re: Refresh token strangeness

It appears the problem is due to the rapidity of calls to get the refresh token.  I have a loop of calls to refresh the token 25 times.  When called I get several successful refreshes, then, I get just an access_token and token_type.  But, if I add a 5 second delay between calls, all 25 work fine.

 

Given that 25 immediate consecutive calls isn't really a valid use case, this doesn't appear to be a problem.  I originally was just experimenting with the API call to get a refresh token when this problem occurred.