docusignapi - Fetching signature image for logged in user using docusign rest api -
i have project in have created form containing fileds:-
1.) name 2.) signature
in signature column there button "add signature" when click on button opens popup enter docusign email , password. once click on login get's signature image url of user. problem code not getting image.
my issue want display signature image after authentication in project. please suggest me wrong in code.
my project url is:-
http://surgimedik.esoftech.in/out/out.adddocument.phpfolderid=1&showtree=1#popup1
admin / admin
you can check below url getting image url. when hit it asks login itstead of showing image.
http://surgimedik.esoftech.in/docusign/test.phpemail=akash@esoftech.org&pwd=terminate@12345
<?php $email = $_request["email"]; $password = $_request["pwd"]; $integratorkey = '4a394221-7742-4f39-8a90-9021732676e8'; $header = "<docusigncredentials><username>" . $email . "</username><password>" . $password . "</password><integratorkey>" . $integratorkey . "</integratorkey></docusigncredentials>"; $url = "https://demo.docusign.net/restapi/v2/login_information?include_account_id=true"; $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) { echo "error calling webservice, status is:" . $status; exit(-1); } $response = json_decode($json_response, true); $accountid = $response["loginaccounts"][0]["accountid"]; $userid = $response["loginaccounts"][0]["userid"]; curl_close($curl); $url_sig = "https://demo.docusign.net/restapi/v2/accounts/$accountid/users/$userid/signatures"; $curl_sig = curl_init($url_sig); curl_setopt($curl_sig, curlopt_header, false); curl_setopt($curl_sig, curlopt_returntransfer, true); curl_setopt($curl_sig, curlopt_httpheader, array("x-docusign-authentication: $header")); $json_response1 = curl_exec($curl_sig); $status_sig = curl_getinfo($curl_sig, curlinfo_http_code); if ($status_sig != 200) { echo "error calling webservice, status is:" . $status_sig; exit(-1); } $response1 = json_decode($json_response1, true); $signatureid = $response1["usersignatures"][0]["signatureid"]; $url_sig1 = "https://demo.docusign.net/restapi/v2/accounts/$accountid/users/$userid/signatures/$signatureid"; $curl_sig1 = curl_init($url_sig1); curl_setopt($curl_sig1, curlopt_header, false); curl_setopt($curl_sig1, curlopt_returntransfer, true); curl_setopt($curl_sig1, curlopt_httpheader, array("x-docusign-authentication: $header")); $json_response11 = curl_exec($curl_sig1); $status_sig1 = curl_getinfo($curl_sig1, curlinfo_http_code); if ($status_sig1 != 200) { echo "error calling webservice, status is:" . $status_sig1; exit(-1); } $result = json_decode($json_response11); echo "https://appdemo.docusign.com" . $result->signatureimageuri;
you using wrong api.
use getimageusersignatures api
get /v2/accounts/{accountid}/users/{userid}/signatures/{signatureid}/signature_image
Comments
Post a Comment