SearchContactByEmail() - returns Contact object with only the Link property

SOLVED
Go to solution
Regular Participant

SearchContactByEmail() - returns Contact object with only the Link property

I am new to Constant Conact API and trying to get rolling here in .NET.  So far I have downloaded the latest .NET API from https://github.com/ctctsupport/Constant-Contact-Dot-Net-WrapperI understand this is a sample for a campaign, but I am building a c# console application to push [new] contacts from our contests to Constant Contact. I am using the ConstantContactBO and ConstantContacUtility projects that I got from the sample code at github. When I call the SearchContactByEmail(AuthenticationData, emailAddress, out nextChunckId) method, ONLY the link property is return in the Contact object (I am including a screenshot for clarity.)  I want all the properties for the contact...at least the ID so I can call the Utility.GetContactDetailsById(AuthenticationData, contactId) to access the remaining properties.

ctctSample.png

1 ACCEPTED SOLUTION

DLLs from the sample code are much older and only useful for the sample forms themselves.  The wrapper library we maintain on Github is the latest versions, with many bug fixes and features added over the years.  Definitely would expect using the old DLLs for anything outside of just demoing how to use the API as potentially causing problems.

Dave Berard
Senior Product Manager, Constant Contact

View solution in original post

7 REPLIES 7
Member

Hello,

 

Is this result the same for every contact email you search? Please contact me via email (webservices@constantcontact.com). In the email, if you can provide the username for the Constant Contact account and one or a small number of email addresses you're using with the search method, I'll see if I can get a test set up with that information, as this may clearly be an issue with the wrapper library.

 

Thanks in advance.

Mark Coleman
Support Engineer

Just to follow up on Mark's comment, I did run the latest version of the wrapper library that is on Github to test this out locally and all information returned from the search results, including ID, is correctly parsed and put into the Contact objects returned from search results.  Here's a screenshot of the values in the debugger when I ran it:

 

CSharpDebuggerScreenshot.png

Dave Berard
Senior Product Manager, Constant Contact

Dave,

 

Thank you for your response - I will try the same test later today.  As requested, I just sent Mark an email that outlines what all I have done to-date.  Please ask him to share it with you.  I think the problem may lie in that I am "mixing" solutions by replacing the ConstantContactBO and ConstantContactUtility projects in the AspContactForms solution with the ones from the DotNetWrapper solution.  I like the features and debug ease of the AspContactForms solution, but I understood you to say a previous thread that the DotNetWrapper had the most current code.

Dave,

 

My test with the DotNetWrapper (downloaded earlier this week) was successful - I now have the ID as well as the other properties just as your screenshot illustrates.  I guess swapping out the ConstantContactBO and ConstantContactUtility  projects from the DotNetWrapper to the AspContactForm was a busted play entirely.

DLLs from the sample code are much older and only useful for the sample forms themselves.  The wrapper library we maintain on Github is the latest versions, with many bug fixes and features added over the years.  Definitely would expect using the old DLLs for anything outside of just demoing how to use the API as potentially causing problems.

Dave Berard
Senior Product Manager, Constant Contact

View solution in original post

Dave,

 

I recalled you saying this as feedback from one of my other posts, which is why I tried "plugging in" the latest ConstantContactBO and ConstantContactUtility projects (not just the DLLs) into the AspNetContactForms solution. Anyway - I was able to test successfully with the DotNetWrapper solution as you directed.  I made a plea to Mark and I'll pass it along to you as well - I would welcome a phone conversation to assist me in getting this automation project going at a bit faster clip.  I sent Mark an email earlier with my contact information...no, I am not SaraB592. Unfortunately, it is our only [allowed] login credential :-(

 

We have 13 brands with many promotional contests. Ultimately, our contests are tied to specific Constant Contact lists, and I need to...

- Query Constant Contact via an opted-in contestant's email to see if the contestant already has an Constant Contact record

- If they have a Constant Contact record, I move on to the next opted-in contestant (i.e do nothing.)

- If they do not have a Constant Contact record, I want to create one AND ASSIGN THEM TO A LIST.

 

So it is essentially a one-way push to add contacts to our Constant Contact lists. Currently, we have to collect the data, and manually upload it to the specicific list...a royal pain.  Once in Constant Contact, they can opt-out....in fact, the ONLY way they can opt-out is via the email that is sent from Constant Contact.

Can certainly give you a call to go over your integration.  Send me a private message with your contact information and we'll have a call scheduled by myself or one of our support engineers.

Dave Berard
Senior Product Manager, Constant Contact
Developer Portal

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

Visit Page