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.

Get 401 error when trying the sample code for ASP.net

Highlighted
New Member

Get 401 error when trying the sample code for ASP.net

I downloaded the sample code for asp.net for "Campaign sample forms" from the following page:


http://developer.constantcontact.com/samples/upload_forms


I tried to click on the link on the default.aspx page for "Listing all email campaigns" and I got the error (401) Unauthorized.


The reason I tried this in the first place is that I am trying to create some campaign programmatically and I could not because of the same problem.


So I need help on passing the authentication.

Sincerely Yours,


Hui Li


 

1 REPLY 1
Highlighted
Occasional Advisor

401 Error

Hello,


In most cases, 401 errors are a result of an improperly formatted login. Your application will need to construct a HTTP Username from a concatenation of your API User Key, the "%" character and the Constant Contact customer's UserName. This information is passed with Constant Contact Customer's Password.


 


Please ensure the username you are passing is formatted as follows, where the string of letters preceding the % is your API key:


 


aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee%username


 

Andrew T

Support Engineer, Constant Contact

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