How to Upload a File to Salesforce in Php

Salesforce files

Files are one of the near powerful ways to manage the content documents in Salesforce. It also refers to a content management system. We have many options such as attachments, documents, Salesforce CRM content to upload a file in Salesforce classic but they are non fully supported or at all in Lightning experience. So it is recommended to forget about the familiar Notes and attachments related list and continue with the files related list in the futurity. In this article, we are going to explicate about differences between files and attachments, file sharing settings, and how to upload a document in files using Balance API and an example.

Comparing Files and Attachments in Salesforce:

The post-obit are the differences between Files and attachments in Salesforce.

Files

Attachments

Files need to upload, shop, detect, follow, share, and interact on Salesforce files in the cloud. Attach files to records from the Attachments related list on selected detail pages.
We can upload a file and store it privately until you're prepare to share it. We can share the files with groups, users, etc. We can add together a file to a specific record such as opportunity, issue by attaching it on the Attachments related list.
It supports all file types. It supports all file types.
The maximum file size can be uploaded is 2 GB. The maximum file size uploaded for file attachments is 25 MB and feed attachments Are 2 GB.

File Sharing Settings:

Files can exist managed in Salesforce based on the post-obit file sharing settings.

  • Private: The file hasn't been shared with anyone else likewise the owner.
  • Privately Shared: The file has been shared only with specific people, groups, or via link. Information technology's non bachelor to all users in your company.
  • Your company: All users in your visitor can find and view this file.

Integrate-Business-Apps-through-APPSeCONNECT

Uploading a document in Salesforce files using REST API

Sometimes there is a requirement to upload a document using Rest API. So, the following are the 3 objects which are used to upload a document in Salesforce files and link information technology to multiple records.

  • Content Version
  • Content Document
  • Content Document Link

Let's take an in detailed knowledge of all the above objects.

Content Version:

This object stores the document information similar like Attachments. Information technology contains the data such every bit content location, path on client, version data, and title.

  • Content Location: It stand for the origin of the document and the valid values are:
    • "Southward": S-Document is located inside the Salesforce.
    • "E": E-Document is located outside the Salesforce.
    • "L": 50-Document is located on a social network and accessed via Social Customer Service.
  • Path on customer: Information technology represents the complete path of the document. In order for the certificate to exist visible in the Preview tab, specify the consummate path including the path extension.
  • Version Information: It contains the file content.
  • Title: It represents the name of the file.

Content Certificate:

It represents a document that has been uploaded to a library in Salesforce Files. There is no need to create this object and it automatically gets created when the content version is created.

Integrate-Business-Apps-through-APPSeCONNECT

Content Document Link:

This object volition be used to share the files with users, records, groups etc. The aforementioned file tin can exist linked to multiple records past using Content Document Link. It tin can too provide the facility to assign the users to access the file with certain permissions. Information technology contains the information such equally content document, linked entity, sharing type, visibility level.

  • Content Document: It contains the content document id which volition exist getting when the content version is created.
  • Link Entity: It contains the record id to which the document has to exist linked.
  • Visibility: It specifies whether this file is bachelor to all users, internal users, or shared users. Visibility tin have the following values.
    • AllUsers: The file is bachelor to all users who have permission to see the file.
    • InternalUsers: The file is bachelor just to internal users who have permission to come across the file.
    • SharedUsers: The file is available to all users who can meet the feed to which the file is posted.

Notation: AllUsers & InternalUsers values apply to files posted on standard and custom object records, but not to users, groups, or content libraries.

  • Sharing Type: It specifies the permission granted to the user of the shared file.
    • "V" (Viewer permission): The user tin view, download and share the file.
    • "C" (Collaborator permission): The user tin can view, download, share the file, edit the details, upload new version and alter sharing settings.
    • "I" (Inferred permission): The user's permission is determined past the related record.

Case:

Let'due south run into an instance to create a certificate in the files department using postman.

Step one: Create a Content Version

salesforce-content-version

Integrate-Business-Apps-through-APPSeCONNECT

Step 2: Fetch the Content Document Id from Content Version.

By using the SOQL query, become the content document id from the content version by passing the content version id.

content-document

Stride 3: Search with the content certificate id in Salesforce to display the created file.

From the below screenshot, nosotros can see that the file has been created and by default it is shared with the created user.

salesforce-content-document

Step iv: Assign the file to a record by using the content document link.

Here, we are linking the to a higher place-created file to an opportunity.

content-document-link

Integrate-Business-Apps-through-APPSeCONNECT

From the below screenshot, the file has been linked to an opportunity in Salesforce.

salesforce-opportunities

Conclusion:

In this way, nosotros tin create a document in Salesforce past using REST API. We sincerely hope that this was useful and any comment or feedback will be very helpful.

Below is the entire video of the procedure!


Integrate-Business-Apps-through-APPSeCONNECT

APPSeCONNECT is a smart and robust business application integration platform that seamlessly connects Salesforce with all your concern applications to streamline operations and facilitate the free-menstruum of data across the platforms. Past moving into the region of iPaaS, APPSeCONNECT proves to exist a best-in-the-grade platform that hands connects systems and automates the business organization process.

At present, you lot tin can easilyconnect all your concern applications nether ane single platform to automate the concern process!

You lot may also similar:
8 Tips to Use Microsoft Teams Like a Pro in your Organisation
Payment Synchronization between SAP Business organization One and Salesforce
Global Variables in Salesforce – All You Need To Know

musgravesplentre.blogspot.com

Source: https://www.appseconnect.com/how-to-upload-a-document-in-salesforce-files-using-rest-api/

0 Response to "How to Upload a File to Salesforce in Php"

Enregistrer un commentaire

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel