PHPackages                             laszlof/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. [API Development](/categories/api)
4. /
5. laszlof/php-salesforce-rest-api

ActiveLibrary[API Development](/categories/api)

laszlof/php-salesforce-rest-api
===============================

v0.2.2(7y ago)057MITPHPPHP &gt;=5.5

Since May 29Pushed 3y ago1 watchersCompare

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

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

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

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

`Bijesh Shrestha` `bjsmasth` `bjsmasth@gmail.com` `bjsmasth` `php rest api`

Install
-------

[](#install)

Via Composer

```
composer require bjsmasth/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 AND SECURITY_TOKEN'
    ];

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

    $access_token = $salesforce->getAccessToken();
    $instance_url = $salesforce->getInstanceUrl();

    Change Endpoint

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

    $access_token = $salesforce->getAccessToken();
    $instance_url = $salesforce->getInstanceUrl();
```

Query

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

    $crud = new \bjsmasth\Salesforce\CRUD();
    $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);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.3% 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 ~124 days

Total

4

Last Release

2895d ago

### Community

Maintainers

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

---

Top Contributors

[![bjsmasth](https://avatars.githubusercontent.com/u/5401401?v=4)](https://github.com/bjsmasth "bjsmasth (16 commits)")[![laszlof](https://avatars.githubusercontent.com/u/1486486?v=4)](https://github.com/laszlof "laszlof (10 commits)")[![clwells](https://avatars.githubusercontent.com/u/8984720?v=4)](https://github.com/clwells "clwells (1 commits)")

---

Tags

phpphp salesforcephp salesforce restphp salesforce rest apibjsmasth

### Embed Badge

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

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

###  Alternatives

[bjsmasth/php-salesforce-rest-api

55112.7k](/packages/bjsmasth-php-salesforce-rest-api)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

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