paravibe / salesforce-wrapper
Salesforce API wrapper for PHP
Installs: 8 776
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 1
Requires
- php: ^8.0 || ^7.0
- guzzlehttp/guzzle: ^7 || ^6
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is auto-updated.
Last update: 2024-11-09 07:11:36 UTC
README
Installation
composer require paravibe/salesforce-wrapper
How to use
Initialize client
$client = new \Salesforce\Client($accessToken, $instanceUrl, $api);
Where $accessToken
is a token retrived during authorization procedure - https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_authentication.htm
$instanceUrl
is a string that was returned during authorization procedure
$api
is an API version to use. E.g. v46.0
Then you can use any method Salesforce supports by passing it into createRequest
:
GET/DELETE methods
$request = $client->createRequest('GET', 'sobjects'); $response = $request->execute()->getDecodedBody();
POST/PATCH methods
$request = $client->createRequest('POST', 'sobjects/SOME_OBJECT'); $request->attachBody(array('field' => 'value')); $response = $request->execute()->getDecodedBody();