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.

401 - An Authentica​tion object was not found in the SecurityCo​ntex.

Highlighted
Advisor

401 - An Authentica​tion object was not found in the SecurityCo​ntex.

Good Morning,

 

I'm simulating running Constant Contact as one of our clients would by using their Constant Contact Account name and password, which we've received permission to do.  When "Get"ing the following URI, I'm able to download their active lists no problem 
"https://api.constantcontact.com/ws/customers/[accountname]/lists"

 

However, when I attempt to get the following URI, I receive the 401 error listed above
"https://api.constantcontact.com/ws/customers/[accountname]/contacts?updatedsince=2000-01-01T00:00:00..."

 

I'm using the exact same credentials string in both cases.

 

WinHttpReq.SetCredentials Credentials, ConstantContactAccountPassword, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER

 

The interesting thing is that if I login as my developer account and run the same code, I get both lists with no errors.

 

My first thought was that I was given the wrong account name or password, but I know it's correct because I get the correct list of lists.  So I know at least that part is correct.  I also know that the credentials string is correct because, again, I get results when just pulling a list of lists.  And as I mentioned, I can login under my developer account and have both sections work fine, so I'm at a loss.

 

We hope to be able to roll our Constant Contact functionality out to this client in the near future  Any thoughts or suggesions would be greatly appreaciated.

 

Regards,

 

Chris Campbell

2 REPLIES 2
Highlighted
Employee

Re: 401 - An Authentica​tion object was not found in the SecurityCo​ntex.

There does not appear to be anything wrong with the string itself. When I perform a get on this (inserting my account information), I am able to pull the listing of contacts without receiving a 401 error.

 

Would you be able to post the code that you are using so that we can take a look at that? If you'd rather email that in, you can feel free to send it to our webservices team and we can look at it there. Thanks!

David J

Highlighted
Advisor

Re: 401 - An Authentica​tion object was not found in the SecurityCo​ntex.

Hi, sorry, upon further testing I've determined that the initial fetch from Constant Contact is working correctly.  The error occurs when I go to fetch the next 50 records.  Since I don't have any lists in my developer account with more than 50 contact I've never run into this before, which explains why one account gets the error and one account doesn't.

 

Okay, so apparently you have to reset the credentials on the http object for each "send" you submit.  Doing so resolves the issue.

 

Don't you love it when issues just work themselves out?

 

Thanks,

 

Chris Campbell

 

 

 

 

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