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.

HTTP Status 401 - Application data not found for key

Highlighted
Member

HTTP Status 401 - Application data not found for key

I am trying to write a script that will call the CTCT API to see if an email already exists in our contacts. For some reason, my username and/or my developer key aren't working -- how do I go about fixing this? 

<?php

//HERE'S WHERE THE DECLARATION OF VARIABLES WOULD BE. 

 

require('cc_api/ConstantContact.php');

$ConstantContact = new ConstantContact('oauth2', $cc_api_key, $cc_username, $cc_api_secret);

//Just trying to grab a list of the contactlists for now to make sure I can authenticate

$Contacts = $ConstantContact->getContacts();

?>

 

Any help would be appreciated. 

 

~Nick

 

 

1 REPLY 1
Highlighted
Honored Contributor

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

Hello Nick,

 

Based on the code and error message you have posted, it appears that you are working with the V1 API wrapper, but are using a V2 API key. Unfortunately these two systems each have unique keys that cannot be used interchangeably.

 

If you generate a new V1 API key, you should be able to use your code immediately. You can create an API key for use with V1 API here : http://community.constantcontact.com/t5/Documentation/API-Keys/ba-p/25015

 

If you do experience any further difficulties, please reply to this post and I will be happy to assist you!

 

Sincerely,

Elijah G.

Tier 2 Support

Elijah G.
API 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