Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All API calls failing due to JSON parse errors #47

Open
jkraemer opened this issue Dec 20, 2016 · 11 comments
Open

All API calls failing due to JSON parse errors #47

jkraemer opened this issue Dec 20, 2016 · 11 comments

Comments

@jkraemer
Copy link

As of today, all API calls using this gem started to fail due to JSON parse errors which were caused by the UTF8 BOM which you apparently have added to every response.

I worked around this by patching the gem / stripping the BOM out in case the initial parsing fails.
If this is an intended / permanent change to your API I could provide a proper fix / pull request.

Cheers,
Jens

@chrismaddocks
Copy link

We had JSON::Parser errors appear starting yesterday, too. They are no longer appearing, but we would be interested to know why the behaviour changed briefly yesterday, and if a more permanent gem fix is required.

@artempartos
Copy link
Contributor

I had issue with parsing JSON, but the reason was that httpaty gem not decoding response when you set aceept-encoding header. It happens because since ruby 2 Net::Http encode/decode it by default, and you shouldn't add this header.
#55

@jrmhaig
Copy link

jrmhaig commented Nov 9, 2017

Is this the same as #58

@marcomarcianesi
Copy link

marcomarcianesi commented Jul 31, 2018

Is the problem back? I'm getting:

CreateSend::BadRequest: The CreateSend API responded with the following error - 400: Failed to deserialize your request

ruby 2.2.4

@marcomarcianesi
Copy link

I solved the issue above. The error was the shape of my payload, and the error message was totally misleading

@barrywoolgar
Copy link

@marcomarcianesi please could you explain what you mean by "shape of my payload"? I'm getting the same message even with very simple payloads. Many thanks

@seanmcoleman
Copy link

I'm also getting the same CreateSend::BadRequest: The CreateSend API responded with the following error - 400: Failed to deserialize your request error on very simple requests.

@rscherf
Copy link

rscherf commented Sep 10, 2019

For others experiencing this, I tried some of the ideas in this thread, however what worked for me was to just go back to v4.1.0, and everything worked. In my case I'm only updating subscribers, so I haven't tested how this change would affect other areas of the gem.

@tusharm
Copy link
Contributor

tusharm commented Sep 10, 2019

@rscherf which version were you using earlier? Also, could you give details about the error you were getting?

@rscherf
Copy link

rscherf commented Sep 10, 2019

@tusharm we were using v5.1.0, doing a standard call to Subscriber#update. The API was the same:

The CreateSend API responded with the following error - 400: Failed to deserialize your request

@Xtinct
Copy link

Xtinct commented Jan 21, 2020

Got the same error, the problem was in ConsentToTrack field value. I was passing true/false instead of Yes/No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants