ballerinax/salesforce.soap Ballerina library

4.2.0

Overview

Salesforce SOAP API provides CRUD operations for SObjects and allows you to maintain passwords, perform searches, and much more.

This module supports Salesforce v48.0 SOAP API Enterprise WDSL.

Prerequisites

Before using this connector in your Ballerina application, complete the following:

  1. Create Salesforce account
  2. Obtain tokens - Follow the steps listed under OAuth 2.0 Web Server Flow for Web App Integration.

Quickstart

To use the Salesforce connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

Import the ballerinax/salesforce and ballerinax/salesforce.soap modules into the Ballerina project.

Copy
import ballerinax/salesforce;
import ballerinax/salesforce.soap;

Step 2: Create a new connector instance

Create a salesforce:ConnectionConfig with the OAuth2 tokens obtained, and initialize the connector with it.

Copy
salesforce:ConnectionConfig sfConfig = {
   baseUrl: <"EP_URL">,
   clientConfig: {
     clientId: <"CLIENT_ID">,
     clientSecret: <"CLIENT_SECRET">,
     refreshToken: <"REFRESH_TOKEN">,
     refreshUrl: <"REFRESH_URL"> 
   }
};

soap:Client soapClient = new(sfConfig);

Step 3: Invoke connector operation

  1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.
    Following is an example on how to convert lead using the connector.
Copy
public function main() returns error? {
  soap:ConvertedLead response = check soapClient->convertLead({leadId = "xxx", convertedStatus: "Closed - Converted"});
}
  1. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/salesforce.soap;Copy

Metadata

Released date: over 2 years ago

Version: 4.2.0

License: Apache-2.0


Compatibility

Platform: java11

Ballerina version: 2201.0.1


Pull count

Total: 95252

Current verison: 7150


Weekly downloads


Source repository


Keywords

Sales & CRM/Customer Relationship Management

Cost/Freemium


Contributors

Other versions

See more...