|
Shelly Warren - 2016-05-22 18:28:34
Hello again,
First, thank you for your help, you are amazing and your code always works so I am pretty sure I missed something...
Please help me, I need to create new accounts in Salesforce and I believe all I needed to do was change the call a little but I am getting this error:
"Error: it was not possible to open the API call URL: it was not specified the protocol type argument" and "MediaType of 'application/x-www-form-urlencoded' is not supported by this resource"
The call:
$success = $this->sfConnObj->CallAPI(
$this->sfConnObj->access_token_response['instance_url']."/services/data/v20.0/sobjects/Account/",
'POST', array("Name"=>"FROGMAN TEST"),
array('FailOnAccessError'=>true,'FollowRedirection'=>true), $test);
I do get a connection and can pull data so I believe the tokens and auth are correct.
Shelly Warren - 2016-05-22 19:04:17 - In reply to message 1 from Shelly Warren
It was me....
I needed to change the call a little, needed to use the RequestContentType/ResponseContentType options:
$success = $this->sfConnObj->CallAPI(
$this->sfConnObj->access_token_response['instance_url']."/services/data/v20.0/sobjects/Account/",
'POST', array("Name"=>"FROGMAN TEST"), array(
'FailOnAccessError'=>true,
'FollowRedirection'=>true,
'RequestContentType'=>'application/json',
'ResponseContentType'=>'application/json'
), $test);
Thanks!!
Manuel Lemos - 2016-05-22 20:14:14 - In reply to message 2 from Shelly Warren
Ok, good to know that you figured it out.
|