Anybody using the .Net Library?

JLandon
Regular Participant

Anybody using the .Net Library?

Hi..


Anybody out there using the .Net Library?


Looking for some samples... I can't seem to the code to work.


thanks

3 REPLIES 3
David_J
Employee

Was there any particular action that you were looking to perform using the .NET Library that was not working? If you could let me know what operation you are looking to perform, I'd be happy to look into this and see if I can provide a sample for you.

David J

JLandon
Regular Participant

Hi..


Yes...


My authentication works but I keep getting 500 errors.

What is wrong with the following. Do you have any .Net library samples?    thanks in advance


 

AuthenticationData authdata = new AuthenticationData();authdata.Username = "USER";


authdata.Password = "PASS";


authdata.ApiKey = "KEY";


ContactList c = new ContactList("TEST",true);


c.SortOrder = 999;


c.Id = "9";


 


 

string uri = " https://api.constantcontact.com/ws/customers/"+ USER+ /activities";      <-- IS THIS CORRECT?


 


StringBuilder sb =

ConstantContactUtility.Components.ContactListComponent.CreateNewContactList(c);


Utility.httpPost(authdata,uri, sb.ToString());

David_J
Employee

It appears that there is an error in our .NET Library that was to blame for this issue, as it was generating invalid XML. This has been corrected and is available for download as v0.04 on our SourceForge Account.


If you're looking to create a new list, I believe that the code below will accomplish that for you. For most actions through the C#.NET Library, you're going to want to go through the Utility class.


AuthenticationData authdata = new AuthenticationData("APIKEY", "USERNAME", "PASSWORD");

Utility.addList("Test", true, authdata);

I hope this helps. Please let me know if you have any questions or concerns regarding this.

David J

Developer Portal

View API documentation, code samples, get your API key.

Visit Page