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.

CC Supplied source code fails to authenticate

Highlighted
Senior Member

CC Supplied source code fails to authenticate

We are using the sample PHP code provided by CC on their site, and of the 3 sample codes we've tried,. all have failed to communicate with CC, returning authorization failures. (401 and the like). When we copy and paste the address that the source code is trying to reach, into our browser, we are prompted for a username and password. We provide the same username and password that we are use to log into our account on CC, but the prompt fails to accept it.

 

We tried the sample code with the CC_Utility class, the class ConstantContact_Contact and class ConstantContact. 

 

The ConstantContact class couldn't even get past the CTCTDataStore check.

 

Can someone please help us make the connection?

1 REPLY 1
Highlighted
Moderator

Re: CC Supplied source code fails to authenticate

I'd like to know specifically which pieces of sample code you are using, as well as when you started to develop with us. Within the last few weeks, we have moved our API key generator to our V2 API, and these new keys will not work with the V1 endpoints. Also, we have updated our sample code to include the V2 API, and these samples no longer use the CC_Utility class.

 

Also, when you access one of the endpoints for v1 (example: /ws/customers/username/contacts), to log in via the browser, the format must be as below, but will only work if you have a V1 API key.

user: apikey%username
password: password

I would suggest taking a look at our new sample code page or any of our V2 wrappers in our Github repo if you are just getting started. If you started development in our V1 API before we launched V2 earlier this month, we can definitely still help you with the V1 code and calls. If so, just send an email to webservices@constantcontact.com with the code you are using, including your changes for authentication, and we can take a look at what is preventing authentication.

Nick Galbraith
Support Engineer
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