Getting a “400 Bad Request” when trying to create a deal
SOLVE
Hi,
I'm creating deals in my Ruby on Rails application and everything's been working fine for months. But two days ago (22nd April 2019), I started getting a 400 Bad Request response despite making no changes to my application.
As Ivan found, HTTParty was improperly setting the Content-Type header with {'Content-Type': 'application/json'}.
From what I can tell, our team made an update to the Deals API on April 22, triggering 400 errors when Content-Type is invalid or omitted. Apologies for the confusion!
I'm sorry to hear that you're encountering issues.
Can you confirm whether the same requests produce 400 errors in a REST client like Postman?
Additionally, could you each define the Hub IDs in which you are attempting to create deals and provide dummy payloads which are consistently throwing 400 errors in your Ruby applications? (If the results differ in a REST client, please let me know.)
As Ivan found, HTTParty was improperly setting the Content-Type header with {'Content-Type': 'application/json'}.
From what I can tell, our team made an update to the Deals API on April 22, triggering 400 errors when Content-Type is invalid or omitted. Apologies for the confusion!