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.

Access token request Problem

Highlighted
Occasional Contributor

Access token request Problem

We´re just starting with Constant Contact API and having problems with the athentication method in the mean time. We are trying to use OAuth2.0 as the documentation says in the following

link 

 

http://community.constantcontact.com/t5/Documentation/Authentication-using-OAuth-2-0-new-October-201...

However, when we request it we got the following error:

{  "error": "invalid_grant", "error_description": "Invalid verification code: xxxxxxxxxxxxxxxxx"}

 

It seems that we have to use  theclient_secret on any place but we have not idea. I hope this is clear..  Could someone

 

help us?

 

thanks

20 REPLIES 20
Highlighted
Employee

Re: Access token request Problem

Hey Jason,

 

If you dont mind posting your code or sending me a PM with it so I can troubleshoot it and see what is going on.  It sounds like your trying to get your Verified token and it is asking for the first token and it is lost during translation so it is giving back an invalid token. 

Ryan Davis
Quality Engineer
Highlighted
Occasional Advisor

Re: Access token request Problem

Hi,

 

I have the same problem.

Could you please help me as well?

 

Thanks in advance

 

Dan

Highlighted
Employee

Re: Access token request Problem

Hi Dan,

 

Sure, no problem.  The Client secret is associated with your API Key.  You can go to this link (and login if not already logged in) to view the client secret associated with your API Key.  

 

Here is a link to some example code for a simple OAuth 2 flow.  All you need to provide is a redirect URI where the user can click a link to generate the access token, your API Key, and client secret.

 

I hope that helps; let me know if you have any other questions.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Advisor

Re: Access token request Problem

Hi Shannon,

 

Thanks a lot for your email.

The authentication is now working.

Only I got a message: "error_description": "Invalid verification code:....

The json file returned is ok...only my returned code is not considered valid in order to do the next steps...

Am I doing something wrong?

Thanks in advance

 

Dan

Highlighted
Occasional Advisor

Re: Access token request Problem

I tried again but I cannot run any method as it says I have an invalid access token...

 

Please help!

 

Thanks

Highlighted
Occasional Advisor

Re: Access token request Problem

This is the json result I am returned...

 

stdClass Object ( [error] => invalid_client [error_description] => Invalid client secret. )

 

but they are valid and the authentication works

Highlighted
Occasional Advisor

Re: Access token request Problem

addtionally the cookies are not set....

Highlighted
Employee

Re: Access token request Problem

Hi,

 

It would probably be best if I take a look at the code and try to make it work in my account.  Are you using the PHP or the .NET wrapper?  Could you email your code to webservices@constantcontact.com so we can take a look?

 

Thanks!

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Advisor

Re: Access token request Problem

Hi Shannon,

 

Thanks for your reply. I am using PHP.

I am sending you now an email.

 

Just a question.. the redirect_uri has to be HTTPS and not HTTP? And if so, Can I also use an external redirect, e.g. https://google.com or https://facebook.com just to get the token?

 

Thanks in advance

 

Dan

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