PHPackages                             diimpp/salesforce-rest-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. diimpp/salesforce-rest-api

ActiveLibrary[API Development](/categories/api)

diimpp/salesforce-rest-api
==========================

Experimental Salesforce rest &amp; bulk api

12.1kPHP

Since Jan 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/diimpp/salesforce-rest-api)[ Packagist](https://packagist.org/packages/diimpp/salesforce-rest-api)[ RSS](/packages/diimpp-salesforce-rest-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Salesforce Rest&amp;Bulk API
============================

[](#salesforce-restbulk-api)

Experimental Salesforce REST and Bulk API implementation, that designed in fashion of facebook php ads sdk.

Currently supports only bulk requests partially.

Installation
------------

[](#installation)

```
composer.phar require diimpp/salesforce-rest-api
```

Usage
-----

[](#usage)

```
$api = \Diimpp\Salesforce\Api::init($accessToken, $instanceUrl);
// or
// $api = \Diimpp\Salesforce\Api::initWithAuthentication($clientId, $clientSecret, $username, $password);

// Example usage of bulk api query.
$job = new Job($api);
$job->create([
    'operation' => Job::OPERATION_QUERY,
    'object' => 'Contact',
    'contentType' => Job::CONTENT_TYPE_XML
]);

$soql = 'select id, lastname, firstname, salutation, name from Contact';

$jobBatch = new JobBatch($job, $api);
$jobBatch->create(['body' => $soql]);
$job->close();

// Wait till job batch will be completed.
while (JobBatch::STATE_QUEUED === $jobBatch->state || JobBatch::STATE_IN_PROGRESS === $jobBatch->state) {
    $jobBatch->read();
}
if (JobBatch::STATE_COMPLETED !== $jobBatch->state) {
    throw new \RuntimeException(sprintf('Salesforce Job Batch request failed with reason: %s', print_r($jobBatch->getData(), true)));
}

$jobBatchResult = new JobBatchResult($jobBatch);
$jobBatchResult->read();

// Salesforce API returns either ID as string or array of IDs of batch results.
if (is_string($jobBatchResult->result)) {
    $data = $jobBatchResult->retrieveData($jobBatchResult->result));
} elseif (is_array($jobBatchResult->result)) {
    foreach ($jobBatchResult->result as $resultId) {
        $data[] = $jobBatchResult->retrieveData($resultId));
    }
}
```

Contributions
-------------

[](#contributions)

Patches and use cases are most welcome.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/870747?v=4)[Dmitri Perunov](/maintainers/diimpp)[@diimpp](https://github.com/diimpp)

---

Top Contributors

[![diimpp](https://avatars.githubusercontent.com/u/870747?v=4)](https://github.com/diimpp "diimpp (12 commits)")

### Embed Badge

![Health badge](/badges/diimpp-salesforce-rest-api/health.svg)

```
[![Health](https://phpackages.com/badges/diimpp-salesforce-rest-api/health.svg)](https://phpackages.com/packages/diimpp-salesforce-rest-api)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)[emartech/emarsys-magento2-extension

Magento2 integration for the Emarsys Marketing Platform

14273.9k](/packages/emartech-emarsys-magento2-extension)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
