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.

Missing ContactCount property in C# .NET library

SOLVED
Go to solution
Highlighted
Occasional Contributor

Missing ContactCount property in C# .NET library

I want to display a collection of Contact Lists and their respective contact counts.

 

I notice that the the ConstantContactBO.ContactList class does not have a ContactCount property, yet if I pull up a list collection through a browser request (https://api.constantcontact.com/ws/customers/{username}/lists) and view the resulting XML, I can clearly see that this information is available.

 

XML snippet:

 

<content type="application/vnd.ctct+xml">
      <ContactList xmlns="http://ws.constantcontact.com/ns/1.0/" id="http://api.constantcontact.com/ws/customers/{username}/lists/1">
        <OptInDefault>true</OptInDefault>
        <Name>General Interest</Name>
        <ShortName>General Interest</ShortName>
        <DisplayOnSignup>Yes</DisplayOnSignup>
        <SortOrder>0</SortOrder>
        <Members id="http://api.constantcontact.com/ws/customers/{username}/lists/1/members"></Members>
        <ContactCount>1</ContactCount>
      </ContactList>
    </content>

 

Is there any reason why this isn't exposed through the C# library? Otherwise, do I have to iteratively get the members of each list to count them? That is a lot of extra overhead for such a simple piece of information.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Employee

Re: Missing ContactCount property in C# .NET library

Hi,

 

Yes, the ContactCount is stable and you can expect it to be returned in our responses for GETs to specific lists (e.g. https://api.constantcontact.com/ws/customers/{username}/lists/{listID} ).

 

I do support my version of the .NET wrapper.  The only thing that is changed is adding support for OAuth2 in that version (currently).  The reason I didn't merge my version with the main .NET wrapper linked to from the Code Samples page is that I use Visual Studio 2010 and I know that because of compatibility issues, someone with VS 2008 wouldn't be able to use my version of the wrapper as is.  The main wrapper would be suitable for both versions (2008 & 2010).  Both of the wrappers should work with VS 2013 as well.

 

The main supported .NET wrapper doesn't have any functionality that my version doesn't.

 

Best Regards,

Shannon W.

API Support Specialist

View solution in original post

3 REPLIES 3
Highlighted
Employee

Re: Missing ContactCount property in C# .NET library

Hi,

 

The ContactCount was added to the APi fairly recently, and we haven't updated the wrapper since that happened.  It would likely be faster to go into the ContactList class and add the contact count to the fields, contructor, and properties regions than to iterate through the members.  Sorry we haven't had the time to update the wrapper.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: Missing ContactCount property in C# .NET library

Hi Shannon,

 

Is that ContactCount element supported/documented/stable or just experimental/unsupported? I can make the necessary changes to the support that property in the wrapper as long as I know it's stable.

 

Is the .NET wrapper with OAuth2 support (https://github.com/shannon7wallace/.NET-wrapper-with-OAuth2) suitable for production use or otherwise endorsed by Constant Contact?

 

I'm assuming this version was modified by you based on the user name, but I don't see any references to it in the Code Samples page at http://community.constantcontact.com/t5/Documentation/Code-Samples/ba-p/25019.

 

Is that modified version up to date compared to the code found at https://github.com/constantcontact/Constant-Contact-Dot-Net-Wrapper or is anything missing?

Highlighted
Employee

Re: Missing ContactCount property in C# .NET library

Hi,

 

Yes, the ContactCount is stable and you can expect it to be returned in our responses for GETs to specific lists (e.g. https://api.constantcontact.com/ws/customers/{username}/lists/{listID} ).

 

I do support my version of the .NET wrapper.  The only thing that is changed is adding support for OAuth2 in that version (currently).  The reason I didn't merge my version with the main .NET wrapper linked to from the Code Samples page is that I use Visual Studio 2010 and I know that because of compatibility issues, someone with VS 2008 wouldn't be able to use my version of the wrapper as is.  The main wrapper would be suitable for both versions (2008 & 2010).  Both of the wrappers should work with VS 2013 as well.

 

The main supported .NET wrapper doesn't have any functionality that my version doesn't.

 

Best Regards,

Shannon W.

API Support Specialist

View solution in original post

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