Skip to main content
9 votes
Accepted

Handle JSON array from REST call

You have an array of objects, so you should use: List<SalesData> resultList = (list<SalesData>) JSON.deserializeStrict( response.getBody(), List<SalesData>....
sfdcfox's user avatar
  • 497k
8 votes

How can I install GMagick on Heroku?

Are you trying to install the graphicsmagick library? If so, you might want to check out this buildpack: https://elements.heroku.com/buildpacks/xerpa/heroku-buildpack-graphicsmagick Also, if you ...
Jon McCartie's user avatar
5 votes
Accepted

Connect an apex trigger to an authorized user's account

Expanding my comment into an answer. I'd suggest you considered using the new Change Data Capture feature instead. Synchronization of Salesforce data to an external persistent store is exactly what ...
David Reed's user avatar
  • 93.2k
4 votes

(400) - Bad Request when requesting auth token using Wordpress

So I got it working. I had to change the Content-Type header to application/x-www-form-urlencoded, which I tried because of this answer. Unfortunately the docs don't tell you that. In fact they say ...
jabyess's user avatar
  • 71
4 votes

How to insert/pass NULL value into Date field

You need to use the fieldsToNull attribute, as noted in the update documentation. $createField["fieldsToNull"] = array("Date__c");
sfdcfox's user avatar
  • 497k
4 votes
Accepted

REST API - PHP - Salesforce- Update Account owner byName

if you know new OwnerId, just assign it to new variable $someOwnerId and put as key to map. $content = json_encode(array("Name" => $new_name, "BillingCity" => $city, "OwnerId" => $...
Oleksandr Berehovskyi's user avatar
3 votes
Accepted

PHP Salesforce Toolkit Parameterized Queries/ SQL Injection Prevention

I've not used the PHP toolkit but often methods exposed via API require you to do your own escaping like you suggest. The parameterisation is only available via Apex I believe. If you're really ...
Matt Lacey's user avatar
  • 25.7k
3 votes

how to integrate salesforce with php in a website?

As @Ratan already said, if you want to use the SOAP API you can go to the developer pages. If you're looking to use the REST API, you can look at this Salesforce Cookbook page. If you're using a PHP ...
Dan Jones's user avatar
  • 7,227
3 votes

Decrypt a string encrypted by the EncryptSymmetric() AMPscript function using PHP

I had the same question and thanks to the great work of @Kolohe with the mcrypt example I found a solution with openssl_decrypt and DES encryption. With the upgrade to php7 we replaced mcrypt with ...
fry2k's user avatar
  • 31
3 votes
Accepted

How to input data into a lookup field through php

The actual field's API Name is AccountId. I know the UI says Account but with pretty much any standard lookup, you actually append Id to the end of the name. There are dozens of examples of this ...
Adrian Larson's user avatar
  • 151k
3 votes

Fields missing from API request

In Salesforce you need to check that your API User has Read Access permission to the fields you are requesting. Setup -> Profiles -> API User -> Field-Level Security
getBalian's user avatar
3 votes
Accepted

Create and Perform a query with PHP SOAP API in ExactTarget

You can't just perform the QueryDefinition using the CustomerKey, you must use the ObjectID for the Query definition. You can find the ObjectID by performing a retrieve on the QueryDefinition Object....
Abhi Reddy Musku's user avatar
3 votes

Can I get a refresh_token using cURL from the command line, or in Salesforce.com itself?

I think you'll be better off using JWT for oAuth. It's more predictable behavior. Here is a PHP github library that I've used that has a lot of the code - https://github.com/adhocore/php-jwt To ...
PartOfTheOhana's user avatar
2 votes
Accepted

Unable to set subscriber status via the PHP API

I finally figured it out, this is what did it for me. Pretty simple actually and then you just need to pass the client object to the function after you've connected. function reActivateSubscriber($...
Stan Alachniewicz's user avatar
2 votes

invalid security token

I was experiencing the same error until I noticed that ExactTarget will return this error if the created timestamp passed to it is in the future as per ET's own current time. Adjusting the time of the ...
Sanil's user avatar
  • 21
2 votes

Pushing data from salesforce org to PHP server

You can make a callout from Salesforce to your PHP application. In this way Salesforce can actively send information to a secondary system. Check out the callout section in the documentation. Keep in ...
user254875486's user avatar
2 votes

SSL certificate problem: unable to get local issuer certificate, curl_errno 60

Just insert some piece of code under the demo_rest.php Line no 11 below curl_setopt($curl,CURLOPT_SSL_VERIFYHOST => false) curl_setopt($curl,CURLOPT_SSL_VERIFYPEER => false)
lovely mano's user avatar
2 votes
Accepted

Can I Upload Remote PDF File to Account via PHP?

I am hoping that you are using Force.com PHP SDK. You can directly call attachment SOAP API with following code. $url = "$instance_url/services/data/v20.0/sobjects/Attachment/"; $...
Himanshu's user avatar
  • 10.5k
2 votes

Is it possible to call webservice methods using SOAP API?

In addition to Daniel's answer to "switch" WSDL in php the below is an example of: Login via the Partner/Enterprise WSDL Pass information to a Webservice WSDL generated from the Apex class in ...
Eric's user avatar
  • 54.2k
2 votes

Is it possible to call webservice methods using SOAP API?

This is likely a limitation of how SOAP and the Force.com Toolkit work. SOAP APIs work by defining a WSDL that describes all the allowed API calls along with their expected parameters and return ...
Daniel Ballinger's user avatar
2 votes

how to integrate salesforce with php in a website?

A bit of a dated question but I've been tasked with this for a project today, so perhaps I've got some useful notes for someone else coming up to the same situation. I came across a PHP library to ...
Adambean's user avatar
  • 121
2 votes

What is the maximum number of records I can send per RESTful API call?

As of v42.0 you can use Composite Collections to INSERT/UPDATE/DELETE up to 200 records at a time. These will be handled in a single execution context. You can also use Composite & Composite ...
NSjonas's user avatar
  • 10.2k
2 votes

I could not perform an Automation immediately by PHP via SOAP

I modified PHP sample code after confirm this page named starting-an-automation PHP Code require('../ET_Client.php'); const OBJ_TYPE = "Automation"; const ACTION_TYPE = "start"; const ...
Akinobu Yamamoto's user avatar
2 votes
Accepted

PHP Soap API - Create Custom Object Record - No fields provided in an external foreign key reference in entity

I've solved this by running the API call describeSObject against my custom object. Looking through the result, I noticed that the record type field's name was instead RecordTypeId There was also a ...
Matt's user avatar
  • 131
2 votes

salesforce rest api invalid session id error when using access token

I do not know php , but essentially there are 2 parts that your program need to cater for , curl command shown below. First, get the session id, then use session id in header to preform the action you ...
Clint D'Silva's user avatar
2 votes
Accepted

Return a tns:QueryResult

Device_Paths__r is a relationship not a concrete field. If it is a lookup relationship, the in a query within salesforce it would be used as follows [Select Device_Paths__r.Name, Device_Paths__r.[...
Eric's user avatar
  • 54.2k
2 votes
Accepted

Fields missing from API request

It is either a permissions issue or the WSDL was generated before the fields were present in the org. Try using the partner wsdl and do a describe on the object and see if the fields come back ...
Eric's user avatar
  • 54.2k
2 votes
Accepted

Is it possible to create a complex filter with php FUEL SDK?

Please check the below sample code which uses ComplexFilterPart using LogicalOperator: https://github.com/salesforce-marketingcloud/FuelSDK-PHP/blob/master/objsamples/sample-folder.php Please make ...
Sharif Ahmed's user avatar
2 votes

How to get more than 2000 records from custom object?

If you're using the SOAP API, just use queryMore. There's no need to use LIMIT/OFFSET, as the system will keep feeding you records until the end. The basic process looks like this: QueryResult qr = ...
sfdcfox's user avatar
  • 497k
2 votes
Accepted

How to get Product Information of an Account?

Product Information is just the name of the section on the page layout which relates to the user interface and is not reflected in the database. The fields in your screenshot are not standard account ...
Aaron P.'s user avatar
  • 1,687

Only top scored, non community-wiki answers of a minimum length are eligible