Connect to Salesforce
After preparing your data files, the next step in loading external data into CRM Analytics is to connect to your Salesforce organization by using standard Salesforce APIs.
The following examples use SOAP API, but you can use any of the Salesforce APIs, such as REST API or Apex. The examples assume that you’re using the Web Services Connector.
To load external data into CRM Analytics, first connect to your Salesforce organization. Use the PartnerConnection object to log in to your organization, as shown in the following example. You need to supply a username, password, and endpoint.
1ConnectorConfig config = new ConnectorConfig();
2config.setUsername(username);
3config.setPassword(password);
4config.setAuthEndpoint(endpoint);
5
6PartnerConnection partnerConnection = new PartnerConnection(config);
For more information about the Web Services Connector (WSC), see Introduction to the Web Services Connector. For more information about user authentication, see Security and the API in the SOAP API Developer Guide.