cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid verification code

Visitor

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
CTCT Employee

Re: Invalid verification code

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