Simple C# GET example (contacts, lists, campaigns, etc.) using XDocument

Highlighted
Occasional Contributor

Simple C# GET example (contacts, lists, campaigns, etc.) using XDocument

Hello,

 

I was searching for a simple C# sample for a read-only (GET) application and came across (after the fact unfortunately) this post:

 

WebRequest / Webresponse Sample

 

which has all the bits I would have needed.   While I've used the design pattern in the above post before, I now try to use XDocument whenever I can as it requires far less scafolding.  There is still some set up of course, but to load a Xml document requires just one line:

 

XDocument Entries = XDocument.Load(XmlReader.Create(Url, XmlReaderSettings));

 

I've posted a very short yet fully functional excerpt of an ASP.NET application here:

 

XDocument Sample

 

Hopefully folks will find this useful.

 

Cheers-

 

1 REPLY 1
CTCT Employee

Re: Simple C# GET example (contacts, lists, campaigns, etc.) using XDocument

Hey Susan

 

Thank you for sharing your examples with us. 

Ryan Davis
Quality Engineer
Developer Portal

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