EmailCollection - 404 error

Highlighted
Occasional Contributor

EmailCollection - 404 error

I am using the following code but I keep getting a 404 error message.

Can someone please help me?

 

Here is the exact error message:

 

The remote server returned an error: (404) Not Found.
at ConstantContactUtility.Utility.GetEmailCollection(AuthenticationData authenticationData, String currentChunkId, String& nextChunkId)

 

Here is the code I am using:

 

AuthenticationData authdata = new AuthenticationData( "xxxxxxx", "xxxx", "xxxxx" );

string _nextChuck = "";
IList<Email> emailsList = Utility.GetEmailCollection( authdata, "1", out _nextChuck );
                
for( int em=0; em < emailsList.Count; em++ )
{

       Response.Write("Email = " + emailsList[ em ] + "<br>");
}

 

Thanks in advance

4 REPLIES 4
Highlighted
CTCT Employee

Re: EmailCollection - 404 error

Hi,

 

I think this is what you want. 

 

string _nextChuck = "";

List<ConstantContactBO.Entities.EmailCampaign> emailsList = Utility.GetEmailCampaignCollection(authdata);
        
     for (int em = 0; em < emailsList.Count; em++)
     {
          Response.Write("Email = " + emailsList[em] + "<br>");
     }

 

Let me know if this helps.  That GetEmailCollection method may be outdated.

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: EmailCollection - 404 error

Thanks for trying to help but I already have the Email Campaign Collection working what I need are the

Email addresses for Reply and Email From so I can fill in the dropdownlists.  So that is why I was using

the EmailCollection method.

 

Can you help me with that?

Highlighted
CTCT Employee

Re: EmailCollection - 404 error

I see.  Sorry for the confusion.  This should work.

 

string _nextChunk;
string _currentChunk = "";

IList<ConstantContactBO.Entities.Email> emailsList = Utility.GetEmailCollection(authdata, _currentChunk, out _nextChunk);


for (int em = 0; em < emailsList.Count; em++)
{
    //Response.Write("Email = " + emailsList[em] + "<br>");
}

 

 

Best Regards,

Shannon W.

API Support Specialist

Highlighted
Occasional Contributor

Re: EmailCollection - 404 error

Thanks that worked

Developer Portal

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