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
... View more