cancel
Showing results for 
Search instead for 
Did you mean: 

(500) Internal Server Error

SOLVED
Occasional Advisor

Re: (500) Internal Server Error

Code being used:

	public InputStream doGetRequest(String link) throws ClientProtocolException, IOException {
		logger.log("Request Url: " + link, LogManager.DEBUG);
		HttpGet httpget = new HttpGet(link);
		HttpResponse response = httpclient.execute(httpget);
	
		int status = response.getStatusLine().getStatusCode();
	
		// If receive anything but a 200 status, return a null input stream
		if(status >= 200 && status < 300) {
			logger.log("Successful request", LogManager.DEBUG);
			return response.getEntity().getContent();
		} else {
			logger.log("Unsuccessful request: " + status, LogManager.DEBUG);
			return null;
		}
	}

This is a subset of the series of URLs being hit:

17/29/2014 14:47:38 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/24707/events/bounces
17/29/2014 14:47:39 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/40549/events/bounces
17/29/2014 14:47:40 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/50396/events/bounces
17/29/2014 14:47:41 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/52330/events/bounces
17/29/2014 14:47:42 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/12459/events/bounces
17/29/2014 14:47:43 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/12512/events/bounces
17/29/2014 14:47:44 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/12570/events/bounces
17/29/2014 14:47:45 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/13201/events/bounces

17/29/2014 14:47:46 : Request Url: https://api.constantcontact.com/ws/customers/[Redacted]/contacts/14045/events/bounces

 

Everything is cool until that last URL, which causes a 500 error. Is there anything on our end that needs to change? Anything special about that particular contact that is causing a problem?

 

Best,

Zachary Telschow (AccuVal-LiquiTec)

Honored Contributor

Re: (500) Internal Server Error

Hi Zachary,

 

I have taken some time to dig into this, and I found that the reason you are seeing an error from that one contact is because that contact was deleted through the UI. When a contact is deleted in the UI, there is no longer any access to that contact's related events. This should definitely be returning a status other than 500, and I will be looking into what we can do about that.

 

The easiest way to avoid this is to double-check the contact's status by making a request to https://api.constantcontact.com/ws/customers/USERNAME/contacts/CONTACTID first to get the status. If the stataus is REMOVED, then you will not have access to the events for that contact.

 

Please let us know if you are still having any issues!

 

Best Regards,

Elijah G.
API Support Engineer
Occasional Advisor

Re: (500) Internal Server Error

Elijah:

 

Unfortunately, your response raises more questions than answers...

 

In terms of the contact you mentioned (http://api.constantcontact.com/ws/customers/[username]/contacts/14045), this contact was deleted via the UI only AFTER we had already received the 500 error while attempting to retrieve contact information. Unfortunately, this issue predates him being deleted.

 

Tangentially, what the process I'm attempting to debug does is:

-get all campaigns from x days ago

-for those campaigns, iterate through them and find any emails that have bounced

-next, take those emails and find out if that contacts email has bounced other times, making them a candidate for removal from our system

 

After we removed 14045, he was still being processed as having been a failed email in a campaign. Is this expected behavior? If so, we're going to need to account for this via the call to retrieve status that you mention. Does contact status appear anywhere in the UI?

 

Lastly, I've run into this issue with another contact. I have not changed it, so it may be more helpful in debugging:

https://api.constantcontact.com/ws/customers/[username]/contacts/17520/events/bounces

 

Thank you so much for your reply and hopefully you can set me straight! Best,

Zachary Telschow (AccuVal LiquiTec)

Occasional Advisor

Re: (500) Internal Server Error

Hitting https://api.constantcontact.com/ws/customers/[username]/contacts/17520 shows that the user is active, but attempting to retrieve their bounces still returns a 500 error. (This reply should serve as an addendum to my earlier post). Any suggestions?

CTCT Employee

Re: (500) Internal Server Error

Hi,

 

We did have a data migration that could have affected data associated with your contacts and caused our server not to be able to return the contact through the API. We've been running data cleanup scripts on our side to resolve the issue for all accounts, and I can have you added to the top of the list of accounts to be fixed. I've sent you an email asking for your username to do this.

 

Sorry for the inconvenience!

 

Best Regards,

Shannon Wallace

Partner API Support Engineer

Occasional Contributor

Re: (500) Internal Server Error

I think I am getting a similar issue for the last couple months.  It appears that when using your API and executing this function Utility.SearchContactByEmail(...) I am getting a timeout after processing about 10 records in my batch cycling through 1 by 1.  Then I wait at least 30+ minutes later and another 10 will go through.  This code was developed back in 2013 without any change since and uses the API utility run time Version v2.0.50727.   I saw on some of the threads that Constant Contact needs to restart some server(s) and or service(s) to get this going again... If so can someone at Constant Contact do that or tell me what needs to be done to eliminate this issue.

Moderator

Re: (500) Internal Server Error

Hi @VC1977,

 

This thread is several years old and refers to our v1 API which is deprecated. Are you using the v1 API and encountering this issue, or are you using our v2 or v3 API? If you are using our v1 API I would highly recommend to look in to updating to one of our other versions.


Regards,
Jimmy D.
Tier II API Support Engineer