We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

HTTP Status 401 - Application data not found for key

MichaelN243
Participant

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
Elijah_G
Member

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