簡體   English   中英

使用REST API的Docusign DEMO帳戶身份驗證不起作用

[英]Docusign DEMO account authentication using REST API not working

我是Docusign的新手。 我有一個開發人員帳戶,並嘗試使用REST API和PHP建立與API的連接,但是我偶然發現並出錯,該錯誤正在調用網絡服務,狀態為0。以下是我的代碼:

$username = "xxxxxx";
$password = "xxxxxx";
$integrator_key = "xxxxxxx";

// construct the authentication header:
$header = "<DocuSignCredentials><Username>" . $email . "</Username><Password>" . $password . "</Password><IntegratorKey>" . $integratorKey . "</IntegratorKey></DocuSignCredentials>";


$url = "https://demo.docusign.net/restapi/v2/login_information";
$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);
//echo $status;
if ( $status != 200 ) {
echo "error calling webservice, status is:" . $status;
exit(-1);
}

$response = json_decode($json_response, true);
$accountId = $response["loginAccounts"][0]["accountId"];
$baseUrl = $response["loginAccounts"][0]["baseUrl"];
curl_close($curl);

這很可能是由於(客戶端)安全軟件,防火牆或其他網絡干擾引起的,因為通過API資源管理器發送請求時,您的請求可以正常工作。 我建議您通過網絡跟蹤您的請求,以了解阻止該請求的地方。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM