cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Status 401 - Unable to authenticate user myaccount

Occasional Contributor

HTTP Status 401 - Unable to authenticate user myaccount

Hi,

I'm trying to communcate with ConstantConact API using PHP  below:

$ConstantContact = new Constantcontact("basic", myapi, myusername, mypass);

 

if i put wrong credentail, I got 401 error. This is OK, i understand this error but this gets diplay on my page. I want to catch the error and show some user friendly error message to user on page.

 

try {
        // Create ConstantContact object and call to ConstantContact api
       $ConstantContact = new Constantcontact("basic", myapi, myusername, mypass);
        
        // Get ConstantContact's account lists
        return $ConstantContact->getLists();
    } catch(Exception $ex) {
    
    }

 

I'm not able to catch the error and i always get the ConstantConact error list on whole page like below:

http://screencast.com/t/yax7I73kpcyW

 

Can you please help me that if my user enter invalid credential and error is returned back then how can i catch this error and show my user friendly errro message to user? Thanks

 

2 REPLIES 2
Highlighted
Valued Contributor

Re: HTTP Status 401 - Unable to authenticate user myaccount

Hello,

 

Thank you for reaching out to us! I'd like to suggest that you actually check out developer.constantcontact.com or e-mail webservices@constantcontact.com for API related questions. We have a team dedicated and trained to handle these types of inquiries and you'll have much better luck getting your questions answered. Thank you so much!

 

Joe


If you find my post helpful, and it answers your question, please mark it as an "Accepted Solution"


Moderator

Re: HTTP Status 401 - Unable to authenticate user myaccount

I put up a respone to your thread in the Getting Started section here: http://community.constantcontact.com/t5/Getting-Started-with-API-s/HTTP-Status-401-Unable-to-authent...

 

Dave Berard
Senior Product Manager, Constant Contact