Salesforce SDK Deployment

This page covers the full deployment sequence for the Conversive Salesforce SDK, including metadata deployment, org configuration, and the recommended post-deployment API validation flow.

Deployment prerequisites

Before starting deployment, make sure:

  • Salesforce CLI is installed
  • The target org is authenticated
  • The Git repository is cloned locally
  • The deploying user has permission to deploy metadata
  • The target org supports the required API version and metadata used by the SDK

Deploy the source

sf project deploy start --source-dir force-app --target-org <your-org-alias>

Replace <your-org-alias> with the alias of the Salesforce org where the SDK should be deployed.

Metadata to deploy

Deploy the full SDK metadata from the repository, including:

  • Apex classes
  • Apex triggers
  • Custom objects
  • Custom fields
  • Permission sets
  • Lightning or Classic layouts
  • Tabs
  • Remote Site Settings
  • Custom settings or custom metadata used for environment configuration

Post-deployment setup

Complete the following steps after metadata deployment.

1

Assign the required permission set

Assign the Conversive Access permission set to every user who needs to access the SDK.

  1. Go to Setup
  2. Search for Permission Sets
  3. Open Conversive Access
  4. Click Manage Assignments
  5. Click Add Assignments
  6. Select the required users
  7. Click Assign
2

Update the Remote Site Setting

Update the Conversive_Staging_API Remote Site Setting so Salesforce can call the correct Conversive endpoint.

  1. Go to Setup
  2. Search for Remote Site Settings
  3. Open Conversive_Staging_API
  4. Update the URL with the correct endpoint
  5. Save the record
3

Set up the environment configuration

Create or update the Conversive_Integration_Details__c record so the SDK has the required environment values.

Required fields:

  • Integration Name
  • API Key
  • Endpoint Path
try {
ConversiveAPI.EnvironmentSettingsResponse resp =
ConversiveAPI.upsertEnvironmentSettings(
'Default',
'your-api-key',
'https://api.beconversive.com'
);
System.debug('Response = ' + resp.response);
System.debug('Message = ' + resp.responseMessage);
System.debug('Value = ' + resp.value);
} catch (Exception e) {
System.debug('ERROR = ' + e.getMessage());
System.debug('STACK = ' + e.getStackTraceString());
}
4

Ensure sender IDs exist

Verify that valid sender records exist in Sender_Id__c.

Without valid sender IDs, outbound messaging APIs may fail.

Post-deployment API validation

After setup is complete, validate the org with the same functional flow your deployment guide recommends.

1. Create a Conversive account

Run this once during onboarding if the org is not already linked to a Conversive account.

try {
ConversiveAPI.ConversiveAPIResponse resp =
ConversiveAPI.createConversiveAccount();
System.debug('response = ' + resp.response);
System.debug('responseMessage = ' + resp.responseMessage);
System.debug('value = ' + resp.value);
} catch (Exception e) {
System.debug('ERROR = ' + e.getMessage());
System.debug('STACK = ' + e.getStackTraceString());
}

2. Confirm balance is available

ConversiveAPI.BalanceResponse resp =
ConversiveAPI.getConversiveBalance();
System.debug('response = ' + resp.response);
System.debug('responseMessage = ' + resp.responseMessage);
System.debug('SMSCredits = ' + resp.SMSCredits);
System.debug('MMSCredits = ' + resp.MMSCredits);

3. Confirm plan details are available

try {
ConversiveAPI.PlanResponse resp =
ConversiveAPI.getConversivePlanDetails();
System.debug('response = ' + resp.response);
System.debug('responseMessage = ' + resp.responseMessage);
System.debug('planDetails = ' + resp.planDetails);
} catch (Exception e) {
System.debug('ERROR = ' + e.getMessage());
System.debug('STACK = ' + e.getStackTraceString());
}

4. Validate plain or bulk SMS

Contact con1 = new Contact(
LastName = 'Test Contact 1',
MobilePhone = '9876543210'
);
Contact con2 = new Contact(
LastName = 'Test Contact 2',
MobilePhone = '9876543211'
);
insert new List<Contact>{ con1, con2 };
Sender_Id__c senderRec = new Sender_Id__c();
senderRec.Label__c = 'Test Sender';
senderRec.Phone__c = '9330909119';
insert senderRec;
ConversiveAPI.MessageResponse resp =
ConversiveAPI.sendBulkSMS(
new List<Id>{ con1.Id, con2.Id },
'Hello, this is bulk text SMS test.',
new List<String>{ 'MobilePhone', 'Phone' },
senderRec.Id
);
System.debug('response = ' + resp.response);
System.debug('responseMessage = ' + resp.responseMessage);

5. Validate MMS with text

Contact con = new Contact(
LastName = 'Test Contact',
MobilePhone = '9876543210'
);
insert con;
Sender_Id__c senderRec = new Sender_Id__c();
senderRec.Label__c = 'Test Sender';
senderRec.Phone__c = '9330909119';
insert senderRec;
ConversiveAPI.MessageResponse resp =
ConversiveAPI.sendBulkMMS(
new List<Id>{ con.Id },
'Hello, this is MMS with text test.',
new List<String>{ 'https://images.unsplash.com/photo-1516387938699-a93567ec168e' },
new List<String>{ 'MobilePhone', 'Phone' },
senderRec.Id
);

6. Validate MMS without text

ConversiveAPI.MessageResponse resp =
ConversiveAPI.sendBulkMMS(
new List<Id>{ con.Id },
'',
new List<String>{ 'https://images.unsplash.com/photo-1516387938699-a93567ec168e' },
new List<String>{ 'MobilePhone', 'Phone' },
senderRec.Id
);

Verification checklist

Functional verification

Confirm the following flows work successfully:

  • Account creation
  • Balance API
  • Plan details API
  • Message status API
  • Plain text SMS
  • Bulk text messaging
  • MMS with text
  • MMS without text
  • Settings update REST endpoints

Technical verification

Also verify the following:

  • Permission set assignment completed successfully
  • The Remote Site Setting contains the correct endpoint
  • The integration settings record was created or updated successfully
  • SDK methods can be executed through Execute Anonymous
  • Apex tests pass successfully
  1. Deploy metadata
  2. Assign the permission set
  3. Update the Remote Site Setting
  4. Configure integration settings
  5. Verify sender IDs exist
  6. Run Execute Anonymous tests for individual APIs
  7. Run Apex tests
  8. Validate end-to-end messaging scenarios

A deployment is complete when metadata is deployed successfully, the environment is configured correctly, sender records are available, the APIs execute without errors, Apex tests pass, and SMS and MMS validation scenarios complete successfully.