{"id":18494049,"url":"https://github.com/matthewpoer/php-salesforce-wrapper","last_synced_at":"2025-08-22T22:14:59.336Z","repository":{"id":62525284,"uuid":"148501240","full_name":"matthewpoer/php-salesforce-wrapper","owner":"matthewpoer","description":"A PHP wrapper for some common Lightning Platform REST API functions","archived":false,"fork":false,"pushed_at":"2020-05-02T01:41:41.000Z","size":7,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T18:54:09.974Z","etag":null,"topics":["api","lightning","pest","php","rest","salesforce"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewpoer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-12T15:23:35.000Z","updated_at":"2022-10-24T11:10:18.000Z","dependencies_parsed_at":"2022-11-02T10:31:34.343Z","dependency_job_id":null,"html_url":"https://github.com/matthewpoer/php-salesforce-wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-salesforce-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-salesforce-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-salesforce-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewpoer%2Fphp-salesforce-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewpoer","download_url":"https://codeload.github.com/matthewpoer/php-salesforce-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247939935,"owners_count":21021874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","lightning","pest","php","rest","salesforce"],"created_at":"2024-11-06T13:17:37.434Z","updated_at":"2025-04-08T22:30:53.834Z","avatar_url":"https://github.com/matthewpoer.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-salesforce-wrapper\n\n## Using Pest for REST\n[Pest](https://github.com/educoder/pest) is a PHP client library for RESTful web services. I found it to be a minimal and effective back-bone for this project. The Pest dependency is handled by composer.\n\nThanks @Educoder!\n\n## Composer Install\n\n```sh\ncomposer require matthewpoer/php-salesforce-wrapper:dev-master\n```\n\n## Get Started\n\n### Authentication\nAuthentication with Salesforce occurs upon instantiation of the wrapper.\n```php\ntry {\n  $sfdc = new php_sfdc_wrapper(\n    SFDC_BASE_URL,\n    SFDC_CLIENT_ID,\n    SFDC_CLIENT_SECRET,\n    SFDC_USERNAME,\n    SFDC_PASSWORD,\n    SFDC_SECURITY_TOKEN\n  );\n} catch (\\Exception $e) {\n  $log-\u003ecritical('Error authenticating with Salesforce. Exception occurred.', array(\n    'Exception' =\u003e $e-\u003egetMessage()\n  ));\n  die('Error authenticating with Salesforce. Exception occurred.' . PHP_EOL);\n}\n```\n\n### Create an Account\n```php\ntry {\n  $account_id = $sfdc-\u003ecreate('Account', array(\n    'BillingCity' =\u003e 'San Francisco',\n    'BillingCountry' =\u003e 'United States',\n    'BillingPostalCode' =\u003e '94105',\n    'BillingState' =\u003e 'California',\n    'BillingStreet' =\u003e 'The Landmark @ One Market Suite 300',\n    'Name' =\u003e 'Salesforce.com',\n  ));\n} catch (\\Exception $e) {\n  $message = $e-\u003egetMessage();\n  $log-\u003ecritical($message);\n  die('Error creating Salesforce Account. Exception occurred.' . PHP_EOL);\n}\n```\n\n### Delete an Account\n```php\ntry {\n  $account_id = $sfdc-\u003edelete('Account', $account_id);\n} catch (\\Exception $e) {\n  $message = $e-\u003egetMessage();\n  $log-\u003ecritical($message);\n  die('Error deleting Salesforce Account. Exception occurred.' . PHP_EOL);\n}\n```\n\n### Find an Account by Name\nThe `query` method accepts as parameters,\n1. an s0bject name\n2. an array of fields desired in the result, defaulting to just the `Id` and `Name` fields\n3. an string to use as the SOQL query's `WHERE` clause\n4. a boolean on whether or not a result should be required (default TRUE). If this is TRUE then the wrapper will throw an exception when no records are found matching the conditions in the `WHERE` clause.\n\n```php\ntry {\n  $accounts = $sfdc-\u003equery(\n    'Account',\n    array('Id','Name'),\n    \"name='Salesforce.com'\",\n    FALSE\n  );\n  foreach($accounts as $account) {\n    echo \"Found account with ID of \" . $account['Id'] . PHP_EOL;\n  }\n} catch (\\Exception $e) {\n  $message = $e-\u003egetMessage();\n  $log-\u003ecritical($message);\n  die('Error querying for the Salesforce Account. Exception occurred.' . PHP_EOL);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewpoer%2Fphp-salesforce-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewpoer%2Fphp-salesforce-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewpoer%2Fphp-salesforce-wrapper/lists"}