Php and salesforce Integration

Hey All,
I have been struggling around to integrate salesforce with third party services ie paypal,amazon s3 etc. So the first step for this is integration the Organization with our system with any language say php. So below are the step by step instruction to get data from salesforce.
1.) Get the salesforce php toolkit from Github
2.)Create a php file that includes 2 files require_once(‘soapclient/SforcePartnerClient.php’);
require_once(“soapclient/SforceHeaderOptions.php”);
3.)Create object of the class
$sfObject = new SforcePartnerClient();
4.) Download the WSDL of your org and add below code
a.) To download the WSDL click Your Name | Setup | Developer | API
$mySoapClient = $sfObject->createConnection(‘wsdl.jsp.xml’);
5.)Connect to the ORG
$crmHandle = $sfObject->login($username, $password . $securityToken);
Here $username=”Your Salesforce Username”
$password=”Your salesforce password”
$securityToken=”Your Salesforce Token”
6.)Finally the complete code Try fetching data from some object
$sfObject = new SforcePartnerClient();
$mySoapClient = $sfObject->createConnection(‘wsdl.jsp.xml’);
$crmHandle = $sfObject->login($username, $password . $securityToken);
$query = “Select id,Name FROM Person__c where Status__c=’Employer'”;
$response = $crmHandle->query(($query));
return $response;
The above steps will help you in connecting to salesforce org and fetching data from it.

Source :  http://www.saasanalogy.com/php-and-salesforce-integration/http://www.saasanalogy.com/php-and-salesforce-integration/

Comments

Popular posts from this blog

Salesforce.com: Expression Operators in Salesforce lightning Components

Custom Calendar on VisualForce Page

Salesforce.com: Scheduled Apex