function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abinash Panigrahi 22Abinash Panigrahi 22 

Upload file to Salesforce using Postman

I tried following Developer Guide but its not that useful https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm

I am unable to test it out using Post man. I am getting error everytime.User-added image
AbhishekAbhishek (Salesforce Developers) 
Hi Abinash,

This blog has step by step guide you can follow it for your requirement,

https://ballardsoftware.com/introduction-to-the-salesforce-rest-api-using-postman/

For reference Refer this links too,

https://stackoverflow.com/questions/39037049/how-to-upload-a-file-and-json-data-in-postman
https://salesforce.stackexchange.com/questions/215655/upload-file-in-salesforce-file-object-using-rest

https://github.com/postmanlabs/postman-app-support/issues/3331

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.
 
Abinash Panigrahi 22Abinash Panigrahi 22
It really helps! Thank you for replying. I am able to do it now. 😊 Regards, Abinash Sent from Outlook Mobile
AbhishekAbhishek (Salesforce Developers) 
Abinash I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks.
vikash mishra 8vikash mishra 8
Abinash can you share json data which worked for you. I am also stuck here:

--boundary_string
Content-Disposition: form-data; name="entity_content";
Content-Type: application/json
 
{
"ContentDocumentId" : "069D00000000so2",
"ReasonForChange" : "Marketing materials updated",
"PathOnClient" : "Q1 Sales Brochure.pdf"
}
 
--boundary_string
Content-Type: application/octet-stream
Content-Disposition: form-data; name="VersionData"; filename="Q1 Sales Brochure.pdf"
 
Binary data goes here.
 
--boundary_string--