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

Advisor

HTTP 406 error on event list API call

Hi,

 

I have just checked in on an automated process that gets event lists and event details for my client (username 0017score) and I'm getting an HTTP error as the event list response: 406 Not Acceptable 

 

-- EDIT --

I'm getting this back in the body of the response: Error 406: '*/*' is not supported

 

Could somebody elaborate on what is going on here. Nothing has changed in the client code in over a week and it was last working fine yesterday.

 

Thanks,

Phil

Phil Ayres

Principle - Consected
14 REPLIES 14
CTCT Employee

Re: HTTP 406 error on event list API call

Hi Phil,


I am currently looking into this for you.  As soon as I can get it to replicate I will post back here.  Please keep me posted if anything changes.

Ryan Davis
Quality Engineer
CTCT Employee

Re: HTTP 406 error on event list API call

Hey Phil,


Can you please provide me with the specific URI that you are requesting the GET from?

Ryan Davis
Quality Engineer
Advisor

Re: HTTP 406 error on event list API call

CTCT Employee

Re: HTTP 406 error on event list API call

Hey Phil,

 

We have done some testing and we found that the issue is coming from where the headers are being declared.  When you set your headers it needs to be in all lowercase.

 

content-type: application/atom+xml
accept: application/atom+xml

For some reason when I used any assortment of capital letters I received a 406 error.  If you can try to update the code accordingly and let me know if this fixes your issue.

Ryan Davis
Quality Engineer
Highlighted
Advisor

Re: HTTP 406 error on event list API call

Sorry, that doesn't fix it

Phil Ayres

Principle - Consected
CTCT Employee

Re: HTTP 406 error on event list API call

Hey,

 

Can you give the snippet of code where you do your request with your headers included?

 

 

Ryan Davis
Quality Engineer
Advisor

Re: HTTP 406 error on event list API call

Actually, I lied. I didn't change the headers in the right piece of code. But, until I can get some more information about what is being passed, I think it is worth noting the following.

 

If I go to a new browser and enter the URL:

https://api.constantcontact.com/ws/customers/0017score/lists

 

It gives me a basic authentication prompt. I can login with the APIKEY%username and password format fine.

 

If I go to:

https://api.constantcontact.com/ws/customers/0017score/events 

in a fresh browser, I just get this response:

Error 406: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' is not supported

 

Based on the fact that the events API appears to be broken, I'm not going to make changes in my code. Once we have the ability to get the events list using basic authentication I'll try again.

 

Phil

Phil Ayres

Principle - Consected
Advisor

Re: HTTP 406 error on event list API call

The code I'm using is Ruby, using the oauth gem, which has been working fine for weeks. There is not very much to see, as it is a simple get request against an access token that was working successfully up until 2 days ago.

 

username = '0017score'
url = "https://api.constantcontact.com/ws/customers/#{username}/events"
res = @access_token.get(url)

 Phil

Phil Ayres

Principle - Consected
CTCT Employee

Re: HTTP 406 error on event list API call

Hey Phil,

 

The reasoning for that error is because /lists does not require the accept: application/atom+xml passed through the header but /events does require it.  Since your going through the prowser and the headers are looking for xhtml its getting that error.  You can read some of the documentation about the events area here.  

 

Our engineers are investing the issue and they are working diligently to a more permanent solution.  

 

Ryan Davis
Quality Engineer