Skip to main content
We are using SOAP API and the Enterprise WSDL to update/Create custom records. Our Client has asked that we automate the attachment portion for them where they are dragging and dropping files for their external partners. We are using automation middleware software to swivel chair this information from host systems into SF. Has anyone been able to use the SOAP API to attach a file to a custom record? Any sample data out there with how to configure our call? Our middleware can do SOAP or Restful.

 

Upload Files via SOAP API (or Rest) into the Files Related List
2 个回答
  1. 2020年4月13日 21:00
    Hi Michael,

     

    For RESTful checkout the following piece from the docs, specifically the "Inserting a ContentVersion" part

     

    https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_insert_update_blob.htm

     

    ​​​​​You can ignore the ContentDocumentId attribute, in such case it will create a new one.

     

    This call will generate the ContentVersion record (which olds the binary) and the parent ContentDocument, you'll then need to create the ContentDocumentLink record (in a separate call) that relates the ContentDocument with the sObject record you wish to related it to

     

    https://developer.salesforce.com/docs/atlas.en-us.sfFieldRef.meta/sfFieldRef/salesforce_field_reference_ContentDocumentLink.htm

     

    https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_sobject_create.htm

     

    Another option may be to use the Composite API, specifically the sObject Tree endpoint and make all in a single call, although I've never tried it with Files to determine if is feasible

     

    https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobject_tree.htm
0/9000