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.

Re: Can't add contact

Highlighted
Occasional Participant

Re: Can't add contact

I already tried to enter that link, but it says "Application data not found for key". I already have my API key created. Why is this happening, or am i missing something?

 

Thanks for your help

17 REPLIES 17
Highlighted
Employee

Re: Can't add contact

Hey Marcie,


Can you provide us with your code so we can see why you are getting that error returned?

 

 

Ryan Davis
Quality Engineer
Occasional Participant

Re: Can't add contact

Hi, I'm using your C# Sample Code. I've already modified the web.config file and added my username, password and mi API Key, but when i try to add a contact i'm getting this exception: System.Collections.Generic.KeyNotFoundException: The given key was not found in the dictionary at line 963: data.AppendFormat(OptInSource{0}/OptInSource", optSourceNames[contact.OptInSource The thing is my key is correct, so i don't know what's going on exactly. Hope you can help me, please. I'm using Visual Studio 2010, i don't know if that affects. Hope you can help me, please

Highlighted
Occasional Participant

Re: Can't add contact

The class is ContactComponent by the way.

Highlighted
Employee

Re: Can't add contact

Hi Marcia,

 

I will need to see the code that you modified so I can troubleshoot it for you.

 

 

Ryan Davis
Quality Engineer
Highlighted
Occasional Participant

Re: Can't add contact

Hi Ryan,

 

  I've only modified the web.config file like this:

 

<configuration>

       <appSettings>

           <add key = "APIKey"  value= "apikey" >

           <add key = "username" value = "username" >

           <add key= "password" value = "password">

      </appSettings>

      <connectionStrings/>

      <system.web>

          <compilation debug= "true">

          <authentication mode = "Windows">

     </system.web>

</configuration>

 

That's the ony thing. The other code is the sample C# code that i downloaded from your page. Btw I'm connected to a proxy server, i don't know if that's affecting me, i'm getting an authentication error message too. Thanks for your time.

 

 

 

Highlighted
Moderator

Re: Can't add contact

Hi Marcia,

 

The code is indicating that the OptInSource dictionary is not finding an entry for the OptInSource value you set.  My best guess is that you did not set an OptInSource at all for the Contact and it's passing a 'null' value instead, which would throw this error.  Try this instead:

 

contact.OptInSource = ContactOptSource.ActionByCustomer;

 

Should fix your problem.

Dave Berard
Senior Product Manager, Constant Contact
Highlighted
Occasional Participant

Re: Can't add contact

Ok, but i still have the authentication issue. I'm connected to a proxy and when i run the project it throws this message: Account authentication failed. I tried in another PC without proxy and it did well. Do you know how to run it with proxy wihout problems? Do i have to add something else to the program?

 

Thanks :smileyhappy:

Highlighted
Occasional Participant

Re: Can't add contact

I'm getting this error message when i run the solution: the remote server returned an error: (407) Proxy Authentication Failed :(

Highlighted
Occasional Participant

Re: Can't add contact

I can't access that page, why is that? =S

 

Thanks

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