Currently I’ve got a nightly update script that pushes our user information from our web dashboard to Hubspot in batches of 50. This is done via a cron-job calling my API call built in Node.js/Express. The first 7 batches go through fine, but the 8th is the first one that has a Chinese character in the name field (other European characters such as ïûá also cause the error), and that fails with the following:
What I’m getting is a 400 Error:
{“status”:“error”,“message”:“Invalid input JSON on line 1, column 43763: Unexpected end-of-input: expected close marker for OBJECT (from [Source: java.io.ByteArrayInputStream@24478e9e; line: 1, column: 41836])\n at [Source: java.io.ByteArrayInputStream@24478e9e; line: 1, column: 43763]”,“correlationId”:“42fd4f6c-1575-4786-a6de-5a5f6ed313e2”,“requestId”:“2e1540b8fcd66bbe6c29b713e7860d07”}
The thing is, if I console out the JSON string I’m sending, it parses fine via JSON Lint, and I can even use it via Postman to update without issue. I’m just wondering if anybody else has run into this, and if so, what they did to fix it.
I’ve tried encoding the characters as unicode numeric references, or HTML entities, and they’ll work, but they show up in Hubspot as the literal string values of said references/entities (IE: 漢語拼音 or %E6%BC%A2%E8%AA%9E%E6%8B%BC%E9%9F%B3)
Any help would be appreciated, as our biggest markets are China and Russia.