We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Invalid verification code

MariusP55
Participant

Invalid verification code

I saw two other posts opened with the same error message but they did not provide sufficient information.

 

I'm using the ruby wrapper for Constant Contact:

 

auth = ConstantContact::Auth::OAuth2.new(
api_key: <key>,
api_secret: <secret>,
redirect_url: <return_url> )

 

Then I get the autorization url:

 

auth.get_authorization_url

 

I'm going through the OAuth2 flow. And then I'm redirected to my application. So far so good. When I try:

 

auth.get_access_token(<code>)

 

I get the "Invalid verification code" error. Any tips on what may be happening here?

1 REPLY 1
Shannon_W
Employee

Hi Marius,

 

If you're waiting any period of time between getting the verification code and using it, that's probably the issue. The verification codes are live for only a few seconds before they expire. You want to automate this to make sure the get access token step is completed immediately after the first call is made to begin the authentication flow.

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

Developer Portal

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

Visit Page