• Muni Chitteti
  • NEWBIE
  • 10 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi All,

I am trying to insert a new document into the Salesforce system referring https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm.

Getting the below error 
[
    {
        "message": "Premature end of input.",
        "errorCode": "JSON_PARSER_ERROR"
    }
]

Input

 
curl -X POST \
  https://company.cs15.my.salesforce.com/services/data/v41.0/sobjects/Document/ \
  -H 'Authorization: OAuth 00De000000........' \
  -H 'Content-Type: multipart/form-data; boundary=boundary_string' \
  -H 'Postman-Token: 0ce6bc42-75a3-45b2-b4d1-03cae18be8b4' \
  -H 'cache-control: no-cache' \
  -d '--boundary_string
Content-Disposition: form-data; name="entity_document";
Content-Type: application/json
{  
    "Description" : "Marketing brochure for Q1 2011",
    "Keywords" : "marketing,sales,update",
    "FolderId" : "00l39000001uYvs",
    "Name" : "Marketing Brochure Q1",
    "Type" : "pdf"
}

--boundary_string
Content-Type: application/pdf
Content-Disposition: form-data; name="Body"; filename="2011Q1MktgBrochure.pdf"

JVBERi0xLjcKCjQgMCBvYmoKPDwKL0ZpbHRlciAvRmxhdGVEZWNvZGUKL0xlbmd0aCA1
NjgKPj4Kc3RyZWFtCnicdVU7jt0wDOx9CtcBRIikfjzGVjnAAkmKvADJ/YsMLUuyn5Ot
tEOLGg4.........iAwIFIKL1Jvb3QgMSAwIFIKL1NpemUgNwo+PgpzdGFy
dHhyZWYKMTEyNgolJUVPRgo=
 
--boundary_string--'

Postman service Image