FuelSDK-PHP icon indicating copy to clipboard operation
FuelSDK-PHP copied to clipboard

OAuth error on SOAP request

Open jmares79 opened this issue 10 months ago • 1 comments

Hi all, for an internal project I need to perform a Data extract. For that I've been following the SDK docs and trying to connect via SOAP.

The issue is that when trying to authenticate with OAuth FALSE, I receive a message as:

"Unable to validate App Keys(ClientID/ClientSecret) provided.: Unable to validate App Keys(ClientID/ClientSecret) provided, requestToken response:{"message":"This integration is not eligible to use the legacy /v1/requestToken endpoint because the integration uses enhanced OAuth 2.0 functionality. To obtain a token for this integration, use the applicable Marketing Cloud OAuth 2.0 endpoint for authentication. For a web or public app, use /v2/authorize and then /v2/token. For a server-to-server integration, use /v2/token.","errorcode":10007,"documentation":""}"

It looks like, from the issues, only OAuth is valid to authenticate now, but I'm not sure how to obtain a token and, even if I can get one, how to use the token with "ET_Client" SOAP class.

Am I missing some steps? The code I'm using to try to create the client is: $client = new ET_Client( false, true, array( 'appsignature' => 'none', 'clientid' => <CLIENT_ID>, 'clientsecret' => <CLIENT_SECRET>, 'defaultwsdl' => 'https://webservice.exacttarget.com/etframework.wsdl', 'baseAuthUrl' => '<URL>', 'baseSoapUrl' => '<SOAP_URL>', 'baseUrl' => '<REST_URL>', 'xmlloc' => <path_to_a_downloaded_WSDL>, 'useOAuth2Authentication' => false, 'proxyhost' => <MY_PROXY>, 'proxyport' =><PORT> ) );

Thanks!

jmares79 avatar Aug 29 '23 08:08 jmares79

I have some working code, but it looks like you are close, and the readme should have some good sample code. Did you try it with the v2 endpoint? One of the things that has tripped me up in the past was the WSDL location. Make sure your path to that is correct. I have downloaded it in the past and modified the path.

garek007 avatar Aug 29 '23 15:08 garek007