Open spsmyth0426 opened 5 years ago
Hei, @spsmyth0426 , I just created a simple Php project in PhpStorm. I guess that the authentication issue you are experiencing is caused by the fact that you don't have the config file (config.php) in the project root folder or you could have some typo in the config file keys. Here is a screenshot of the structure of my sample project:
Hey @sfcbetiuc , thanks for the response! I just confirmed that my config.php file is in the root folder of the project, see the screenshot below:
Currently this is what my file config looks like, with the 'XXX' replaced and validated against the correct clientid & clientsecret:
<?php
return array(
'appsignature' => 'none',
'clientid' => 'XXX',
'clientsecret' => 'XXX',
'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
'xmlloc' => '/some/path/to/cache/ExactTargetWSDL.xml',
'baseUrl' => 'https://www.exacttargetapis.com',
'baseAuthUrl' => 'https://auth.exacttargetapis.com',
'baseSoapUrl' => 'https://webservice.exacttarget.com/Service.asmx',
'proxyhost' => 'localhost',
'proxyport' => '8080',
'proxyusername' => '',
'proxypassword' => '',
);
What steps can I take to troubleshoot what is happening?
It's probably because you don't have that proxy for which you would have those settings in the config file. You can either create that proxy or you can simply comment or remove the four lines of your config file regarding the proxy settings and everything should work fine.
Thanks @CCBet I removed those as suggested, and that seems to resolve the initial error. However when trying to execute a simple test the page is 'loading' until chrome quits the page. Is there a reason a simple call like the one below wouldn't load?
<?php
include_once('tests/UnitBootstrap.php');
use FuelSdk\ET_Client;
use FuelSdk\ET_DataExtension;
try {
$myclient = new ET_Client();
//DataExtension Testing
//Get all Data Extensions
print_r("Get all Data Extensions \n");
$getDE = new ET_DataExtension();
$getDE->authStub = $myclient;
$getDE->props = array("CustomerKey", "Name");
$getResult = $getDE->get();
print_r('Get Status: '.($getResult->status ? 'true' : 'false')."\n");
print 'Code: '.$getResult->code."\n";
print 'Message: '.$getResult->message."\n";
print 'Result Count: '.count($getResult->results)."\n";
//print 'Results: '."\n";
//print_r($getResult->results);
print "\n---------------\n";
}
catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
?>
This error was ouath2 library and i am able solve this issue but to get data extensions getting error
Get all Data Extensions Caught exception: DTD are not supported by SOAP
sometimes it's slow due to their server load
I'm having this same issue (unable to validate keys), not sure what I'm doing wrong.
My environment is on my iMac, MacOS Mojave 10.14.6, MAMP 5.1.1, PHP 7.2.8, I have SSL configured on 'localhost2' for port 443.
I created a 'Connected App' on salesforce using this guide: Salesforce Authentication
I have made sure our external IP at our office is whitelisted on both the app itself and our networking settings on salesforce (although since IP restrictions are relaxed I wouldn't think it would matter). I've seen mention on this thread something about 'publishing' the keys but can't find any salesforce documentation on that.
My PHP file (salesforce_retrieve.php):
<?php
ini_set('display_errors', 1);
require 'vendor/autoload.php';
use FuelSdk\ET_Client;
use FuelSdk\ET_List;
$myclient = new ET_Client(true);
$getList = new ET_List();
$getList->authStub = $myclient;
$getResponse = $getList->get();
print_r($getResponse);
?>
My config.php file (which is in root):
<?php
return array(
'appsignature' => 'none',
'clientid' => 'XXX',
'clientsecret' => 'XXX',
'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl',
'baseUrl' => 'https://www.exacttargetapis.com',
'baseAuthUrl' => 'https://auth.exacttargetapis.com'
);
Image of file structure:
Any help?
This SDK is for marketing cloud. You are trying to use it with Sales Cloud. You need to create an installed package in your Marketing Cloud instance. @jshw
I'm having this same issue (unable to validate keys), not sure what I'm doing wrong.
My environment is on my iMac, MacOS Mojave 10.14.6, MAMP 5.1.1, PHP 7.2.8, I have SSL configured on 'localhost2' for port 443.
I created a 'Connected App' on salesforce using this guide: Salesforce Authentication
I have made sure our external IP at our office is whitelisted on both the app itself and our networking settings on salesforce (although since IP restrictions are relaxed I wouldn't think it would matter). I've seen mention on this thread something about 'publishing' the keys but can't find any salesforce documentation on that.
My PHP file (salesforce_retrieve.php):
<?php ini_set('display_errors', 1); require 'vendor/autoload.php'; use FuelSdk\ET_Client; use FuelSdk\ET_List; $myclient = new ET_Client(true); $getList = new ET_List(); $getList->authStub = $myclient; $getResponse = $getList->get(); print_r($getResponse); ?>
My config.php file (which is in root):
<?php return array( 'appsignature' => 'none', 'clientid' => 'XXX', 'clientsecret' => 'XXX', 'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl', 'baseUrl' => 'https://www.exacttargetapis.com', 'baseAuthUrl' => 'https://auth.exacttargetapis.com' );
Image of file structure:
Any help?
When trying to set up the following simple example I'm seeing an error:
Trying to debug this, I added a print_r inside the refreshToken function and and result of $authObject is
Although when I print out the $jsonRequest object I am seeing the correct client Id & Secret. I have cross validated these creds using a simple postman auth request and they are working correctly there.
What am I missing to get authenticated?