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>....
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 ...
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 ...
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 ...
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");
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" => $...
3
votes
Accepted
SOAP API username and password
If you are using SOAP API for login functionality ,please note that the Username and Password are your user credentials .
Also kindly note that password here is a combination of Password + Security ...
3
votes
session id or oath token, they not interchangeable?
Session Id values and Authorization tokens are indeed interchangeable. In fact, I often use Session Id values instead of a token when I'm mocking a quick JavaScript function in my browser. For example:...
3
votes
Accepted
The Triggered Send is not completely configured or in a new status
For Triggered Send emails, I would recommend against creating a new TriggeredSend for each email that is sent. A TriggeredSend should be created once to represent the campaign or specific type of ...
3
votes
Accepted
Creating Case via PHPToolkit fails to activate email queue
You need to specify the EmailHeader in order to trigger emails (it defaults to false). This will cause the system to send out any notifications it would normally.
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 ...
3
votes
Accepted
Modifying data using SOQL?
See the various examples in Getting Started with the Force.com Toolkit for PHP.
You use SOQL to query:
$query = "SELECT Id, FirstName, LastName, Phone from Contact";
$response = $mySforceConnection-&...
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 ...
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 ...
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 ...
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
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....
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 ...
2
votes
Accepted
Query Result: Where does "any" come from?
You need to wrap the response in a QueryResult object which'll do the work of decoding the any array for you. e.g.
$response = $mySforceConnection->query($query);
$queryResult = new ...
2
votes
Accepted
how to submit a geolocation field via the API create command?
You need to set the latitude and longitude separately; the main field is a compound field that can only be read, similar to how Account.ShippingAddress combines all of the address fields.
Sample:
...
2
votes
Accepted
how to send an email by setting the templateid using php tool kit --->Single email method
while sending email using setTemplateId you need to consider following points
When you use templateId you need targetObjectId as well.
As per the documentation Targetobjectid can be only record id of ...
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 ...
2
votes
Call <link rel="stylesheet" href=""> On A Specific Part Of My Page Without Overriding My Current CSS Style
I really doubt that this question belongs here.
The CSS conflicts can be resolved by adding a namespace to your css file. You may use this namespaced bootstrap from SalesforceFoundation.
The above ...
2
votes
Accepted
Salesforce REST API with PHP, INVALID_SESSION_ID after successful authentication
I found the answer, I had the wrong syntax for setting the curl headers. I tried to pass the values as an associative array, but the correct way is like this:
curl_setopt($ci, CURLOPT_HTTPHEADER, ...
2
votes
How to use the apexrest with C#
A .NET tool kit was announced by salesforce.
"The Force.com Toolkit for .NET provides an easy way for .NET developers to interact with the Force.com REST API using a native libraries."
https://...
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($...
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)
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 ...
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 ...
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/";
$...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
php × 317marketing-cloud × 90
api × 74
soap-api × 63
rest-api × 39
fuel-sdk × 36
soap × 22
soql × 17
oauth2 × 17
curl × 17
integration × 16
rest × 13
php-toolkit × 12
apex × 11
authentication × 9
query × 8
ampscript × 7
custom-object × 6
force.com × 6
webservices × 6
oauth × 6
wsdl × 6
heroku × 6
trigger × 5
fuel × 5