cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

The most newbie question in the world?

Occasional Participant

The most newbie question in the world?

I'm using a free account and attempting to test the API but have been hitting a major roadblock, likely of my own design.

 

I have tried sending the following uri as per the lists overview page:

 

https://api.constantcontact.com/ws/customers/ecogeeks2/contacts

 

I am then presented with a dialogue asking for username and password. I enter the credentials, which are not accepted (on multple tries) If I then cancel the dialogue I see the following 401:

 

HTTP Status 401 - Application data not found for key: ecogeeks2

 

I'm assuming I'm making a big colorful boneheaded mistake here but I'm at a loss to find it.

 

Thanks in advance,

 

John

 

8 REPLIES 8
CTCT Employee

Re: The most newbie question in the world?

Hi John,

 

I can definitely help you with the issues you are having.  May I ask what type of integration you are building, and what programming language you will be using?

 

In order to gain access to our API's, you will want to get an API key.  You can get them from here.  The way to submit the credentials would be the username: APIKEY%username, and the then the password is just your account password.

 

The best way to test the API out would be to use a REST client, such as the java REST client found here.

 

If you run into any other issues please let me know and we can continue to work on this with you!

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact
Occasional Participant

Re: The most newbie question in the world?

Hi Benjamin and thanks for the quick reply!

 

I do have an API key - 2 in fact. I talked to a tech support rep this morning, who was very helpful despite my not yet being a paid customer, and my questions not being in his area of responsibiity. He bumped my issue up to a second tier tech who said I would need to create a developer account. I did this although it seems to me I have simply created a second  trial account although I did the second sign-up from the developer community.

 

My application is in php, very simple at this point - collecting opt-in email accounts from our ecommerce application and exporting them into Constant Contact.  I've already written the script and my xml looks correct, but I get 400 error on all attempts. The issues are identical with either account.

 

I took a step backwards and tried sending a simple request as detailed here:

http://community.constantcontact.com/t5/Documentation/Listing-All-Contacts/ba-p/25061

 

I have been unsuccessful with this on either account, as detailed above.

 

Thanks,

John

 

Occasional Participant

Re: The most newbie question in the world?

Benjamin -  I got a bit further, re-read your reply and tried the concatination - the simple access now works - missed a description of how the username is constructed in the example from the document or it's missing. In any case at least I know I'm not trying to walk through a brick wall as far as my earlier suspicion of potential restrictions of free accounts. Thanks for the info, and I'll get back to coding

 

Moderator

Re: The most newbie question in the world?

If you're doing work in PHP and hoping to get started quickly, I would recommend leveraging our PHP wrapper library.  It will do most of the XML parsing and API work for you and leave you up to the logic of how your integration will work.  You can find the library here: http://community.constantcontact.com/t5/Documentation/Code-Samples/ba-p/25019

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Re: The most newbie question in the world?

Hi Dave and thanks for the info. I've already downloaded the wrapper include, and also the sample php code. I built off of the sample code which uses a different class include (cc_class.php) - should I avoid using cc_class and stick with ctctWrapper.php?

Moderator

Re: The most newbie question in the world?

The cc_class.php example will work, though the features are limited to only a few options.  The ctctwrapper.php example is a fully functioning wrapper.  Depending on what you're doing, cc_class.php may fit your needs.  It is the older sample we have though and is no longer updated.

Dave Berard
Senior Product Manager, Constant Contact
Occasional Contributor

Re: The most newbie question in the world?

I have the same problem.  I tried to connect to https://api.constantcontact.com/ws/customers/{APIK​ey}h-gac/ and it will not accept my user name and password.  If I cancel out then I get a "HTTP Status 401 - Application data not found for key: h-gac".   Can you help?

CTCT Employee

Re: The most newbie question in the world?

Hello,

 

The URI you want to connect to is https://api.constantcontact.com/ws/customers/USERNAME/

 

You would not put the API key, username, and password in the URI.  You put these in the authentication area, depending on which scripting language you are using.  If you are using one of our wrappers, there is usually a variable that we set for them.  I would suggest taking a look at our sample code, here.

 

If you have any questions please let me know.

 

Regards,

Benjamin Soder
NOC Analyst
Constant Contact