Skip to content

Instantly share code, notes, and snippets.

@seanpat09
Last active May 9, 2017 19:47
Show Gist options
  • Save seanpat09/261d36badb47e0eaf4f809d4844cdf13 to your computer and use it in GitHub Desktop.
Save seanpat09/261d36badb47e0eaf4f809d4844cdf13 to your computer and use it in GitHub Desktop.
Bulk API Sample JSON Error
From Salesforce's documentation for sample JSON to the Bulk API
(https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/datafiles_json_sample_file.htm):
[
{
"Name" : "Xytrex Co.",
"Description" : "Industrial Cleaning Supply Company",
"Account Number" : "ABC15797531"
}
{
"Name" : "Watson and Powell, Inc.",
"Description" : "Law firm. New York Headquarters",
"Account Number" : "ABC24689753"
}
]
Thought it was weird that there were no commas between the objects, but figured that was just some Salesforce weirdness.
But that meant we had to build this weird JSON object on our own instead serializing a JSON array.
A few hours later:
JsonParseException: Unexpected character ('{' (code 123)): was expecting comma to separate ARRAY entries at [Source: java.util.zip.GZIPInputStream@6333202b; line: 2, column: 2]
#salesforcedotcomeon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment