PHPackages                             jerkob/php-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. jerkob/php-salesforce-rest-api

ActiveLibrary

jerkob/php-salesforce-rest-api
==============================

Salesforce REST API PHP library

v0.7(3y ago)02.5k↓100%MITPHPPHP &gt;=7.2

Since May 29Pushed 3y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (1)Versions (8)Used By (0)

Php Salesforce Rest Api
=======================

[](#php-salesforce-rest-api)

Originally forked from: which was forked from:

Changelog
---------

[](#changelog)

Guzzle 7 and PHP &gt;=7.2 are required starting with version 0.7.

Versions 0.6 and below require Guzzle 6 and PHP &gt;=5.6.

Install
-------

[](#install)

Via Composer

```
composer require jerkob/php-salesforce-rest-api
```

Getting Started
===============

[](#getting-started)

Setting up a Connected App

1. Log into to your Salesforce org
2. Click on Setup in the upper right-hand menu
3. Under Build click `Create > Apps `
4. Scroll to the bottom and click `New` under Connected Apps.
5. Enter the following details for the remote application:
    - Connected App Name
    - API Name
    - Contact Email
    - Enable OAuth Settings under the API dropdown
    - Callback URL
    - Select access scope (If you need a refresh token, specify it here)
6. Click Save

After saving, you will now be given a Consumer Key and Consumer Secret. Update your config file with values for `consumerKey` and `consumerSecret`

Setup
=====

[](#setup)

Authentication

```
    $options = [
        'grant_type' => 'password',
        'client_id' => 'CONSUMERKEY',
        'client_secret' => 'CONSUMERSECRET',
        'username' => 'SALESFORCE_USERNAME',
        'password' => 'SALESFORCE_PASSWORD' . 'SECURITY_TOKEN'
    ];

    $salesforce = new jerkob\Salesforce\Authentication\PasswordAuthentication($options);
    $salesforce->authenticate();

    $accessToken = $salesforce->getAccessToken();
    $instanceUrl = $salesforce->getInstanceUrl();

    Change Endpoint

    $salesforce = new jerkob\Salesforce\Authentication\PasswordAuthentication($options);
    $salesforce->setEndpoint('https://test.salesforce.com/');
    $salesforce->authenticate();

    $accessToken = $salesforce->getAccessToken();
    $instanceUrl = $salesforce->getInstanceUrl();
```

Query

```
    $query = 'SELECT Id,Name FROM ACCOUNT LIMIT 100';

    $crud = new \jerkob\Salesforce\CRUD($instanceUrl, $accessToken);
    $crud->query($query);
```

Create

```

    $data = [
       'Name' => 'some name',
    ];

    $crud->create('Account', $data);  #returns id
```

Update

```
    $new_data = [
       'Name' => 'another name',
    ];

    $crud->update('Account', $id, $new_data); #returns status_code 204

```

Upsert

```
    $new_data = [
       'Name' => 'another name',
    ];

    $crud->upsert('Account', 'API Name/ Field Name', 'value', $new_data); #returns status_code 204 or 201

```

Delete

```
    $crud->delete('Account', $id);
```

Describe

```
    $crud->describe('Account');
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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.

###  Release Activity

Cadence

Every ~359 days

Recently: every ~314 days

Total

7

Last Release

1112d ago

PHP version history (3 changes)v0.1PHP &gt;=5.5

v0.5PHP &gt;=5.6

v0.7PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/f28091a1f1d6c739514e00416c7ac01b7bc51b8d3903136fea0e99024f6f452b?d=identicon)[jerkob](/maintainers/jerkob)

---

Top Contributors

[![jerkob](https://avatars.githubusercontent.com/u/523301?v=4)](https://github.com/jerkob "jerkob (20 commits)")[![bjsmasth](https://avatars.githubusercontent.com/u/5401401?v=4)](https://github.com/bjsmasth "bjsmasth (15 commits)")[![kwiercioch](https://avatars.githubusercontent.com/u/5021386?v=4)](https://github.com/kwiercioch "kwiercioch (2 commits)")[![mtymek](https://avatars.githubusercontent.com/u/777893?v=4)](https://github.com/mtymek "mtymek (2 commits)")[![laszlof](https://avatars.githubusercontent.com/u/1486486?v=4)](https://github.com/laszlof "laszlof (1 commits)")

---

Tags

php salesforcephp salesforce restphp salesforce rest api

### Embed Badge

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

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

###  Alternatives

[bjsmasth/php-salesforce-rest-api

55112.7k](/packages/bjsmasth-php-salesforce-rest-api)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k20](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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