cancel
Showing results for 
Search instead for 
Did you mean: 
Constant Contact wants to help you succeed! We’re celebrating our professional service programs on the Constant Contact Community this month and you have a chance to try one of the services for free! Learn more.

HTTP 406 error on event list API call

Highlighted
Occasional Contributor

Re: HTTP 406 error on event list API call

We also started getting this error yesterday.

 

Since most of us use 3rd party oAuth libraries, customizing the capitalization of the headers isn't something we often can easily change. Why is this something that was changed? The capitalization of header text isn't something that should break a previously working API request.

Advisor

Re: HTTP 406 error on event list API call

Ryan,

 

I see for the first time in the API docs the requirement for   accept: application/atom+xml

 

I've been happily ignoring this requirement for months, so whatever is being passed in is the default OAuth headers from my Ruby gem (probably Accept: */*, which could be considered to be valid presumably).

 

For a simple Get request, adding headers seems unnecessary. And since it wasn't enforced previously by the API, and other Constant Contact APIs don't request it, suddenly requiring it makes little sense, and seems inconsistent. I don't see the value, unless the developers are going to quietly sneak in other response formats in the near future (in which case a URI parameter requesting the required format would be way easier to handle, and would be inline with Google, Salesforce, Twitter and everybody else I've integrated with).

 

So, my preferred solution to this is to remove the required headers, to take us back to where we were previously, and not try and match the documentation.

 

My SCORE client is waiting on a solution, since they are not getting new workshops published on their new mobile websites, and are not getting reports of attendance, essential for their reporting to the SBA. Just so you understand why this is important to prioritize.

 

Thanks,

Phil

Phil Ayres

Principle - Consected
CTCT Employee

Re: HTTP 406 error on event list API call

Hey Guys,

 

Our engineers are working on this issue and I will have more information tomorrow.  I understand this is frustrating for everyone and we are working on more permanent fix. 

 

Ryan Davis
Quality Engineer
Advisor

Re: HTTP 406 error on event list API call

I have just tested the solution Ryan suggested, using headers. After some trial and error I got it to work.

 

Bear in mind, event APIs (both list and event details)  require lowercase content-type and accept headers. Registrant APIs have also been broken / enforced, but these for some reason only require the accept header. Since I'm not submitting any content in the event API, I don't really like the idea of adding a header indicating a content-type, and I don't like it breaking the HTTP RFC for being case insensitive. But it works for now.

 

For anybody using the Ruby OAuth gem, here is an example of how to add lowercase headers to the Get request submitted against an access token:

 

url = "https://api.constantcontact.com/ws/customers/#{username}/events"
headers = {'accept'=>'application/atom+xml', 'content-type'=>'application/atom+xml'}
res = @access_token.get(url, headers)

 

Phil

Phil Ayres

Principle - Consected
CTCT Employee

Re: HTTP 406 error on event list API call

Hey Phil,

 

Thank you for letting me know this worked and providing an example. 

Ryan Davis
Quality Engineer