无法从DisputeSuite连接到CRM API

时间:2014-02-07 15:10:31

标签: php vb.net api soap

我正在尝试使用名为DisputeSuite的CRM中的API。我得到的错误是“无效的进程名称”。我对进程名称有正确的价值,所以我的问题似乎就是放在哪里。

这是我的代码:

$compKey = 'xxxx';
$apiKey = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
$soapURL = "https://www.securecrmsite.com/Modules/System/API.asmx?wsdl";
$soapCredentials = array('Credentials'=>array('CompanyKey' => $compKey, 'APIKey' => $apiKey));
$soapFunctionParameters = array('FirstName' => "From", 'LastName' => "API");
$client = new SoapClient($soapURL, array('trace' => true));
$client->Process($soapCredentials, "CustomerInsert", $soapFunctionParameters);
echo $client->__getLastResponse();

这是API文档。 (他们只有VB版本。)

Credentials  Credentials() (Collection of valid and active API Key and Company Key)  Your valid and active system   credentials
ProcessName  String  CustomerInsert
WebServiceParams     WebServiceParams()(Collection of name/value pairs)  

Public Shared Sub Main()
     InvokeProcess()
End Sub

Public Shared Sub InvokeProcess()
     Dim api As api = New api
     Dim credentials As ApiCredentials = New ApiCredentials
     credentials.CompanyKey = "test"
     credentials.APIKey = "test"
     Dim parameters(28) As ApiParams

     Dim parameters_0 As ApiParams = New ApiParams
     parameters_0.Name = "JointCustomerID"
     parameters_0.Value = "[VALID VALUE]"
     parameters(0) = parameters_0
    ...
     Dim parameters_27 As ApiParams = New ApiParams
     parameters_27.Name = "AllowEmails"
     parameters_27.Value = "[VALID VALUE]"
     parameters(27) = parameters_27
     Dim processResult As ApiResponse = api.Process(credentials, "CustomerInsert", parameters)
     Dumper.Dump("result", processResult)
End Sub

非常感谢您给予的任何帮助,谢谢!

1 个答案:

答案 0 :(得分:0)

您可以将其用作:

$client = new SoapClient('https://www.securecrmsite.com/Modules/System/API.asmx?WSDL');
$response = $client->Process(array('Credentials' => (array('CompanyKey' => '0000','APIKey' => 'KEY' )),'ProcessName' => 'UsersSearch','Parameters' => (array('Name' => 'a' )) ));

print_r($response);