{"id":256,"date":"2025-03-19T15:07:12","date_gmt":"2025-03-19T16:07:12","guid":{"rendered":"http:\/\/gogetmuscle.com\/?p=256"},"modified":"2025-03-19T17:38:47","modified_gmt":"2025-03-19T17:38:47","slug":"intermittent-error-invalid-json-input-a-request-body-was-expected-but-none-found","status":"publish","type":"post","link":"http:\/\/gogetmuscle.com\/index.php\/2025\/03\/19\/intermittent-error-invalid-json-input-a-request-body-was-expected-but-none-found\/","title":{"rendered":"Intermittent error: “Invalid JSON input: a request body was expected, but none found”"},"content":{"rendered":"

Hey everyone! We seem to be getting an HTTP status code 400 from HubSpot every so often. The error will state, “Invalid JSON input: a request body was expected, but none found.” However, we’ve checked everything, and we definitely are sending a request body when this happens; we’ve added logging to our calls just to double check, and it does look like we are sending a body, as well as a\u00a0Content-Type<\/EM> and\u00a0Content-Length<\/EM> header.<\/SPAN><\/P>
\n

\u00a0<\/P>
\n

The error does not seem to be contained to any one endpoint. We’ve seen the error on:<\/SPAN><\/P>
\n

POST https:\/\/api.hubapi.com\/crm\/v3\/objects\/:customObjectId:\/search\u00a0
<\/SPAN><\/P>
\n


\n
POST https:\/\/api.hubapi.com\/crm\/v3\/objects\/contacts\/batch\/read<\/a><\/SPAN><\/DIV>
\n
and\u00a0<\/SPAN><\/SPAN>
\n

\n
POST https:\/\/api.hubapi.com\/crm\/v3\/lists\/:listId\/memberships\/add<\/a><\/SPAN><\/DIV>
\n
\u00a0<\/DIV>
\n
I logged the CF-Ray response header for one of the failing requests to the list membership add endpoint. It was\u00a0<\/SPAN><\/SPAN>
\n

\n
921ad2b04e4ffeff-PDX for the request on March 17, 2025 at 2:37 AM CDT. Please let me know if there’s any more data I can give you guys.<\/SPAN><\/DIV>
\n<\/DIV>
\n<\/DIV>
\n<\/DIV>
\n<\/DIV>
\n<\/DIV>
\n

\u00a0<\/SPAN><\/P><\/p>\n","protected":false},"excerpt":{"rendered":"

Hey everyone! We seem to be getting an HTTP status code 400 from HubSpot every so often. The error will state, “Invalid JSON input: a request body was expected, but none found.” However, we’ve checked everything, and we definitely are sending a request body when this happens; we’ve added logging to our calls just to […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/256"}],"collection":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/comments?post=256"}],"version-history":[{"count":1,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/256\/revisions"}],"predecessor-version":[{"id":257,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/posts\/256\/revisions\/257"}],"wp:attachment":[{"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/media?parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/categories?post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gogetmuscle.com\/index.php\/wp-json\/wp\/v2\/tags?post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}