Last active
December 16, 2015 06:09
-
-
Save MasonM/5390016 to your computer and use it in GitHub Desktop.
Nutshell PHP soap client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('USERNAME', '[email protected]'); | |
define('PASSWORD', '43c789d483fd76547b1f157e3cf5e580b95b9d8c'); | |
function findEndpoints($username) { | |
$soapClient = new SoapClient("http://api.nutshell.com/v1/soap?wsdl"); | |
return $soapClient->getApiForUsername($username); | |
} | |
$endpoints = findEndpoints(USERNAME); | |
$soapOptions = array( | |
'soap_version' => SOAP_1_2, | |
'user_agent' => 'Nutshell', | |
'login' => USERNAME, | |
'password' => PASSWORD, | |
'trace' => true, | |
); | |
$soapClient = new SoapClient("http://{$endpoints['api']}/api/v1/soap?wsdl", $soapOptions); | |
var_dump($soapClient->newAccount(array('name' => 'this is a test'))); | |
echo $soapClient->__getLastRequest(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment