Question

"Could not parse body"


Badge

Is anyone else having issues with the Communities REST API, specifically the /external-content/index endpoint, where it’s suddenly returning the error “Could not parse body”?


6 replies

Userlevel 4

@ndollimo_bt can you return the body in logging so that we can see what it looks like? I saw this and just ran out our federated search indexing and it is fine.

Badge

@rhall Here’s the body JSON I’m sending. I also checked our GitHub to make sure the syntax hasn’t changed and it doesn’t appear to have been changed. I’ve edited the content of the values but the structure is there; note that it’s returning the same error for every single request. Currently doing one item per request while testing and I’ll move to larger batches later.

{
  "batch": [
    {
      "title": "KB Title",
      "content": "Some content text",
      "url": "https://kburl.test",
      "source": "knowledgebase_identifier"
    }
  ]
}

 

Badge

@rhall I forgot to mention that I’m getting the same response when hitting the /external-content/clear endpoint as well. Further apologies, it’s probably good to mention that this is in our sandbox as well as we haven’t launched production yet.

Userlevel 4

Ah, I haven’t tried this in our sandbox. I’ve just dismantled that and have nothing set up there at the moment. But your body looks absolutely fine. I suspect that this may be an issue in the sandbox. As long as you are providing the correct source to the clear endpoint, I have never seen that fail. 

I would raise a support call.

Userlevel 4

@ndollimo_bt I was thinking about this and it occurred to me that you *may* be including some non-escaped characters in your content or title. I actually had something like this a while ago. It was a single “ that wasn’t escaped in my content that caused this. If you are including all of the text from the page your URL points to, this may be what is causing your issue.

Badge

@rhall I was thinking the same thing so I tested by just submitting “Test” as the content text for every entry, instead of pulling the real values, and it results in the same error. I’ll probably be doing your previous suggestion and opening a support call. Thanks for the replies and I’ll report back.

Reply