Join our Ask A Trainer Sessions and Chat With our Great Trainers!

Refresh token missing

SOLVED
Go to solution
Anonymous
Not applicable
0 Votes

I'm following the OAuth2 Authorization Code Flow on CC API v3 to get my access and refresh token. However on step 4 I only get the access token. The refresh token is missing. Why?. Here's the response:

{
    "token_type": "Bearer",
    "expires_in": 86400,
    "access_token": "********",
    "scope": "contact_data"
}

On my App settings states that:

This application supports:



1 ACCEPTED SOLUTION
josephineo
Campaign Expert

The solution: I re-read the API Server Flow Guide and saw something mentioned that i did not include in my initial attempt: -- you MUST add "offline_access" to the scope to get the refresh token:  Here it the paragraph from the doc:

 

scope — The type of data in Constant Contact that the user is granting your application permission to use. The offline_access scope is required to get a refresh token.

 

View solution in original post

6 REPLIES 6
josephineo
Campaign Expert
0 Votes

I, too, have the same issue as TACmarketing.  It makes not difference if the application is configured as "rotating refresh tokens" or "long lived refresh tokens".  Below is a screen shot of the JSON representation of the POST response

josephineo_0-1645655517214.png

 

 

josephineo
Campaign Expert

The solution: I re-read the API Server Flow Guide and saw something mentioned that i did not include in my initial attempt: -- you MUST add "offline_access" to the scope to get the refresh token:  Here it the paragraph from the doc:

 

scope — The type of data in Constant Contact that the user is granting your application permission to use. The offline_access scope is required to get a refresh token.

 

Anonymous
Not applicable
0 Votes

Thanks @josephineo,
I missed that altogether from the docs

user0543981
Rookie
0 Votes

Thank you JosePhineo. I missed it too.

John__B
Employee

Hello TACmarketing,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

It looks like @josephineo already came up with the solution in an above comment but based on your response, it looks like the only scope included in your authentication request was the 

“contact_data” scope. In order to obtain a refresh token the “offline_access” scope must also be included in the request. Below I am including the overview documentation for our available OAuth 2.0 flows.

 

OAuth 2.0 Overview:

https://developer.constantcontact.com/api_guide/auth_overview.html

 

Please have a look and let us know if you have any other questions!

 

Regards,


John B.
API Support Specialist
Did I answer your question? If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Anonymous
Not applicable
0 Votes

Thanks @John__B

Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up