Docusign api 连接

Docusign api Connect

我遇到演示连接问题API
https://demo.docusign.net/restapi
要连接到 API,我使用下面提供的代码。它适用于我来自美国的同事,但当我尝试从立陶宛连接时,响应为零。

会不会有任何位置限制,或者我错过了什么?
它应该是防火墙中的一些细节(我在 NAT 下)吗?
我的本地 php/http 服务器需要一些特定的配置吗?

$email = "some email @ fsdfdsf";
$integratorKey = "TEST-xxxxxxxxxxx";
$password = "some password";

$url = "https://demo.docusign.net/restapi/v2/login_information?include_account_id_guid=true";
$header = "<DocuSignCredentials><Username>" . $email . "</Username><Password>" . $password . "</Password><IntegratorKey>" . $integratorKey . "</IntegratorKey></DocuSignCredentials>";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array("X-DocuSign-Authentication: $header"));
$json_response = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

if($status==200){
    $response = json_decode($json_response, true);
    print_r(json_encode($response['loginAccounts'][0]));
}else{
    print_r($json_response);
}

DocuSign 不对 API 客户实施任何位置限制。

您可以通过尝试从网络浏览器使用该服务来检查您的防火墙是否允许连接到 DocuSign。尝试 demo.docusign.net

您也可以使用浏览器directly access a method in the API server that provides information on the API service points.

如果它有效,那么您就知道问题出在您的 API 代码中。 如果是这样,请先尝试 API recipes.

之一

如果您无法访问网络服务,请检查您的防火墙设置。

我在上面找到了一个正在停止工作的源代码。 在我的本地服务器上,ssl 没有签名。 如此简单且仅在测试环境中快速修复可能是关闭 curl 上的 ssl 检查:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

或获取签名的 ssl 证书。

我就是这样解决的,我加了$config->setSSLVerification(false);你关闭ssl验证

 $username = "marko@XXX.com";
$password = "XXX";
$integrator_key = "some_key";     

// change to production before going live
//https://www.docusign.net/restapi
//https://www.docusign.com/p/RESTAPIGuide/Content/GettingStarted/REST%20API%20Version.htm
$host = "https://demo.docusign.net/restapi";

 // create a new DocuSign configuration and assign host and header(s)
$config = new \DocuSign\eSign\Configuration();
$config->setHost($host);
$config->setSSLVerification(false);
$config->addDefaultHeader("X-DocuSign-Authentication", "{\"Username\":\"" . $username . "\",\"Password\":\"" . $password . "\",\"IntegratorKey\":\"" . $integrator_key . "\"}");
// instantiate a new docusign api client
$apiClient = new \DocuSign\eSign\ApiClient($config);