Secure File Transport

Installation Guide - P2 Container

Note : Check the Webhook URL in the Postman(Application) for every Environment Before Entering the Webhook URL in plaid Credentials.

1. Introduction

Secure File Transport is a native Salesforce AppExchange application that lets users securely send and receive files directly inside Salesforce, without passwords, PINs, logins, or external apps.

The P2 Container feature extends Secure File Transport with a container-based exchange: a single secure container can carry multiple push (send) and pull (request) items in one session with the end user, with status tracked back into Salesforce via webhooks.


2. Intended Users

  • Salesforce Admins – Responsible for setup and configuration.

  • End Users – End users who receive/upload files.

  • Salesforce Users – Responsible for requesting or sending files to end users.


3. Prerequisites

System Requirements

  • Salesforce Professional, Enterprise, Unlimited, or Developer Edition

  • Secure File Transport managed package installed (see Section 4)

  • A BotDoc account with an API key and a registered email per profile/business unit

User Roles & Permissions

  • Admin Access – Required for installation and configuration

  • Author Apex permission – Required to run the setup scripts in the Developer Console

  • Access to Setup → Sites and Domains to expose the webhook endpoint


4. Installation


Using Salesforce AppExchange Link
  1. Go to Salesforce AppExchange

  2. Search for Secure File Transport

  3. Click "Get It Now" and select the Salesforce environment (Production or Sandbox)

  4. Follow the on-screen prompts to install the package

  5. Assign user permissions during the installation process


Using Direct Package Link
  1. Reach out to support@cloudmaveninc.com for the latest managed package link

  2. Follow the on-screen prompts to install the package

  3. Assign user permissions during the installation process


5. Post-Installation Setup

Complete the post installation setup to ensure seamless application functionality

5.1 Assign the License

Every user must be assigned a user license to access the App Secure File Transport . A user's license determines the baseline of features that the user can access.

  1. Navigate to Setup.

  2. Use the Quick Find or Search Setup box to search for and select the specific user requiring the Secure File Transport license.

  3. Click on the user's name to access their detailed user record.

  4. Scroll down the user detail page to locate the "Managed Packages" related list.

  5. Click the "Assign Licenses" button associated with the "Managed Packages" section.

Screenshot 2025-03-24 at 5.04.52 PM.png
  1. Click the "Add" button to assign the selected "Secure File Transport" license to the user.

Screenshot 2025-08-20 at 5.39.34 PM.png

5.2 Assign the Required Permission Set

  1. Navigate to Setup.

  2. Use the Quick Find box to search for "Permission Set".

  3. Locate the "Cloud Maven's - SFT - P2 Permissions" permission set from the list.

  4. Click on "Manage Assignments".

  5. Assign the permission set to the relevant users.


5.3 Enable the P2 Feature

The P2 feature is disabled by default and must be switched on per org.

  1. Open the Developer Console.

  2. Go to Debug → Open Execute Anonymous Window.

  3. Run:

cm_datatransfer.AdminUtilityServices.enableP2Feature(true);
  1. Confirm the execution completed successfully in the log.


5.4 Source Object Field Mapping

This setting will be used to auto-populate the P2 Request form with the values from the Source Object. Make an entry in this setting to Map the Field of Source Object(Account, Contacts any Standard or Custom Object) with required parameters.

  • Click on the Gear Icon and go to setup.

  • Search for Custom Setting in Quick Find Box.

  • Click on Manage of “File Request Field Mappings”.

Screenshot 2026-07-24 at 4.23.28 PM.png
  • Create below Entries for P2 Request Type:

    • First Name

    • Last Name

    • Phone

    • Email

  • Click on New to Create New Entry for Pull Request.

Screenshot 2026-07-24 at 4.20.43 PM.png


Note: Similarly complete the entries for the above-mentioned fields.


5.5 Configure the Common Settings

Navigate to Setup -> Custom Settings -> Data Transfer Settings

Update the below fields as per Requirement

  • RequestByEmail

    • True if request to initiate a P2 container is made using Email

  • RequestByPhone

    • True if request to initiate a P2 container is made using SMS

  • TfaMethod

    • Method to receive the

    • Two-factor authentication Code.

    • Populate the Value with SMS or Email

  • TfaRequired

    • True if Two-factor Authentication is Required

  • ErrorBatchMessages

    • time,Unavailable,Bad,reset,Server,error,failed

  • P2StatusNextRunTime

    • Provide the time-frequency to run the batch that updates the container Status.

    • It only picks the Secure P2 Container records that are in Sending status and Created in Last 50 Days

    • For Example - If you want the batch to run in every 2 minutes, Populate the value field with 2.


5.6 Insert BotDoc Credentials for Profiles

Run the below script to enter the credentials for BotDoc

cm_datatransfer.AdminUtilityServices.saveBotDocP2Credentials(
    <env_name>, <api_key>, <email>, <endpoint>, <iframeURL>
);

(Optional) P2 also can stores credentials per profile, so that each profile picks up its own email + API key combination when connecting to BotDoc. Run the script below once per profile:

cm_datatransfer.AdminUtilityServices.saveBotDocP2Credentials(
    <profile_name>, <api_key>, <email>, <endpoint>, <iframeURL>
);

Parameter

Description

<env_name>

Sandbox or Production

<profile_name>

Name of the Salesforce profile the credentials apply to. Required because P2 supports multiple keys across profiles.

<api_key>

API key from the BotDoc portal

<email>

Email address configured in the BotDoc portal

<endpoint>

https://api.botdoc.io/

<iframeURL>

https://apiframe.botdoc.io/chat


5.7 Configure the Site to Receive Webhooks

Create a Site

  1. Go to Setup → User Interface → Sites and Domains → Sites.

  2. Create a new Site, or use an existing one.

Grant Apex class access to the Site User

Give the Site user access to:

  • WebhookP2Container

Grant Apex class access to the Site Guest User

Give the Site guest user access to:

  • P2FeatureTriggerHandler

  • P2ContainerTriggerHandler


5.8 Update the Webhook (Callback) URL in the Credentials

For every set of credentials created in Section 5.6, run:

cm_datatransfer.AdminUtilityServices.updateCallbackURL(<profile name>, <callbackURL>);

Parameter

Description

<profile_name> or <env_name>

Profile name or Environment used when inserting the credentials

<callbackURL>

Built from your Site domain (see below)

Callback URL format:

<Site Domain>/<path if present>/services/apexrest/cm_datatransfer/processP2ContainerStatus

Example (sandbox):

https://<your-org>--full.sandbox.my.salesforce-sites.com/services/apexrest/cm_datatransfer/processP2ContainerStatus

5.9 Update the Email Template in the Credentials

For every set of credentials created, run:

cm_datatransfer.AdminUtilityServices.updateEmailTemplateSlug(<profile name>, <template name>);

Parameter

Description

<profile name>or <env_name>

Profile name or Environment used when inserting the credentials

<template name>

Template slug from the BotDoc portal


5.9 Combined Script: Credentials, Callback URL and Email Template

Rather than running Sections 5.6, 5.8 and 5.9 individually, use the loop below to configure every profile in one execution. Replace the profile list with the profiles in your org.

List<String> listProfiles = new List<String>{
    'Profile Name 1',
    'Profile Name 2',
    'Profile Name 3'
};

for(String profile : listProfiles){
    cm_datatransfer.AdminUtilityServices.saveBotDocP2Credentials(
        profile,
        <apikey>,
        <email>,
        'https://api.botdoc.io/',
        'https://apiframe.botdoc.io/chat'
    );
    cm_datatransfer.AdminUtilityServices.updateCallbackURL(
        profile,
        'https://<your-site-domain>/services/apexrest/cm_datatransfer/processP2ContainerStatus'
    );
    cm_datatransfer.AdminUtilityServices.updateEmailTemplateSlug(
        profile,
        'default-template'
    );
}


5.10 Disable Chat and iFrame (Optional)

  1. Go to Setup → Custom Settings → Functionality Settings.

  2. Check the following options as required:

    • DisableChat_P2iFrame

    • Disable_P2ConsumerChat


5.11 Configure the Batch Where Clause

This setting is used in the WHERE clause of the batch that checks the status of a P2 request and moves it from Sending to Sent.

  1. Go to Setup → Custom Settings → DataTransfer Settings.

  2. Click Manage → New.

  3. Enter:

Field

Value

Name

P2StatusBatch_WhereClause

Value

WHERE cm_datatransfer__Api_Status__c = 'Sending' AND CreatedDate = LAST_N_DAYS:50


5.12 Set the Frequency of the P2 Container Status Batch

  1. Go to Setup → Custom Settings → DataTransfer Settings → New.

  2. Enter:

Field

Value

Name

P2StatusNextRunTime

Value

n (in seconds)

  1. Click Save.


5.14 Schedule the Batches

Batch to update the status of the P2 Container

cm_datatransfer.BatchGetP2ContainerStatus oBatch = new cm_datatransfer.BatchGetP2ContainerStatus();
Database.executeBatch(oBatch, 1);

Batch to send Reminder Emails (As Required)

BatchP2ReminderEmail oBatch = new BatchP2ReminderEmail();
Database.executeBatch(oBatch, 1);


5.15 Create P2 Secure File Templates

Follow the steps in How to create P2 Secure File Templates.


5.16 Create P2 Request button

  1. Go to Setup → Object Manager → Select the Source Object

  2. Click on → Buttons, Links, and Actins → New Action.

Enter the below details and Save

Screenshot 2026-07-29 at 3.54.45 PM.png

5.17: Add button to the Page Layout

  1. Go to Setup → Object Manager → Select the Source Object

  2. Click on Page Layouts → Select the Desired Page Layout → Mobile & Lightning Actions

  3. Drag and Drop the ‘P2 Request’ button on the Page Layout

Note: You can avoid this step if the component needs to be added on the record page rather than as a button.


5.18: Add P2 Inbox on the Lightning Page

  1. Go to Setup → Object Manager → Select the Source Object

  2. Click on Lightning Pages → Select the Desired Page → Edit

  3. Below components could be added as required:

    1. displayMediaList (display All Medial Files collected)

    2. secureP2ContainerRequest (initiate P2 Container Request)

    3. secureP2Container (For P2 Inbox)


  1. Create Lookup of Secure P2 Container on the Source Object

  2. Add the Related List on the Source Object

    1. Go to Setup → Object Manager → Select the Source Object

    2. Click on Page Layouts → Select the Desired Page Layout → Related Lists

    3. Drag the Secure P2 Container under the Related List Sections. You can add below fields:

      1. BotDoc Container ID

      2. Status

      3. Created date

      4. Send Method

      5. Recipient’s Status

      6. Last Online

  3. Create a flow to populate the Lookup based on the Parent Record Id on the Secure P2 Container record

https://cloudmaven.atlassian.net/wiki/external/NzdlNmFmZTAzOTk4NDEzMWI5YmZmZWQzZTM2NDA4NDY




6. Support

You have successfully installed and configured the P2 Container feature of the Secure File Transport application.

For further information or troubleshooting, please write to us at support@cloudmaveninc.com.