bjsmasth/php-salesforce-rest-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bjsmasth/php-salesforce-rest-api

最新稳定版本:v0.2

Composer 安装命令:

composer require bjsmasth/php-salesforce-rest-api

包简介

无描述信息

README 文档

README

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

Install

Via Composer

composer require bjsmasth/php-salesforce-rest-api

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

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(); $result = $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); 

统计信息

  • 总下载量: 110.51k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 54
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 54
  • Watchers: 1
  • Forks: 67
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固