API integration no longer working

RobertJ298
Rookie
0 Votes

We have a POS system that integrates with Constant Contact.  I don't know if this is a temporary issue, or if the API methods we have used are no longer supported.  When trying to pull down contact lists for instance, we are getting a 401 error.  I've removed my user email address, api key and token for security reasons, but those have not changed and used to work.  

 

GET /ws/customers/xxxxxxxxxxxxxxxxxx/lists?api_key=xxxxxxxxxxxxxxxxxxxxxx&access_token=xxxxxxxxxxxxxxxxxxxxxxx
Host: api.constantcontact.com
User-Agent: http-api/1.32
Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
recvresp(): entered
HTTP/1.1 401 Unauthorized

1 REPLY 1
Courtney_E
Employee
0 Votes

Hello RobertJ298,

 

Thank you for reaching out to Constant Contact API Developer Support. My team is here to assist outside software developers with questions about building into Constant Contact's API.

 

Based solely on the example provided, the authorization header should be set to Bearer, rather than Basic, and the API key itself shouldn’t be necessary within the request. To make an authenticated call to the Constant Contact API, the application should only need one of the following:

 

Option 1: Add a header to the HTTP request:

Authorization: Bearer access_token

 

Option 2: Append the token as a parameter to REST URIs, as in: 

https://api.constantcontact.com/ws/customers/joesflowers/campaigns?access_token=the_token

 

The 401 responses indicate an authentication problem, and typically is caused by an invalid API key, invalid API key/username format or an actual bad username and/or password combination. 

 

However, we were unable to determine the cause of the issue based on our logs, as the calls returning a 401 response seem to be failing intermittently using the same format as the successful requests that proceed and follow them.

 

Our V1 API is no longer supported and is currently in the process of being deprecated, so the assistance we are able to provide is limited. We strongly recommend converting your integration to use our V3 API as soon as possible, as the V2 API is already considered legacy, and there will be a point where it will be depreciated as well. Our V3 API offers better security, better documentation, more functionality, active development, and ongoing support. Documentation for the V3 API can be found here: 

https://v3.developer.constantcontact.com/api_guide/index.html 

 

Please let us know if you have any other questions! You can also reach our team directly via email at webservices@constantcontact.com if your inquiries include sensitive data.

 

Regards,

Courtney E.

Tier II API Support Specialist


Regards,

Courtney E.
Tier II API Support Engineer

Did I answer your question?
If so, please mark my post as an "Accepted Solution" by clicking the Accept as Solution button in the bottom right hand corner of this post.
Resources
Developer Portal

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

Visit Page

Announcements

API Updates

Join our list to be notified of new features and updates to our V3 API.

Sign Up