2014-11-05 1 views
0

내 응용 프로그램은 EchoSign (받는 사람 변경)과 함께 현재받는 사람과 작업하기 위해 논리를 사용합니다. 봉투 사용 DocuSign API의 현재 수신자를 검색 할 수 있어야합니다. 어떻게 가능할까요?봉투의 현재받는 사람 받기

답변

1

DocuSign Developer Center으로 시작해야합니다. 관련 API에 대한 훌륭한 자료입니다. 개발자 센터의 빠른 시작 섹션을 살펴보면 API 도구 섹션이 표시되며 여기에는받는 사람 상태 가져 오기와 같은 작업을 수행하는 방법을 보여주는 무료 코드 샘플이 있습니다.

API DOCUMENTATION

API를 연습

API TOOLS

현재받는 사람의 상태를 확인하는 방법에 대한 예제가 있습니다. 다음은 전체 PHP 샘플입니다 :

<?php 

    // Input your info here: 
    $email = "***";   // your account email 
    $password = "***";  // your account password 
    $integratorKey = "***";  // your account integrator key, found on (Preferences -> API page) 

    // copy the envelopeId from an existing envelope in your account that you want to query: 
    $envelopeId = 'cbe279f6-199c-.................'; 

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

    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    // STEP 1 - Login (retrieves baseUrl and accountId) 
    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    $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); 

    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); 

    //--- display results 
    echo "\naccountId = " . $accountId . "\nbaseUrl = " . $baseUrl . "\n"; 

    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    // STEP 2 - Get envelope information 
    ///////////////////////////////////////////////////////////////////////////////////////////////// 
    $data_string = json_encode($data);                     
    $curl = curl_init($baseUrl . "/envelopes/" . $envelopeId . "/recipients"); 
    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 . "\nError text --> "; 
     print_r($json_response); echo "\n"; 
     exit(-1); 
    } 

    $response = json_decode($json_response, true); 

    //--- display results 
    echo "First signer = " . $response["signers"][0]["name"] . "\n"; 
    echo "First Signer's email = " . $response["signers"][0]["email"] . "\n"; 
    echo "Signing status = " . $response["signers"][0]["status"] . "\n\n"; 
?> 
+0

모든 수신자를 나열하고 각각에 대한 상태를 확인하지 않고도 할 수있는 방법을 찾을 수 있습니다. 하지만 지금 당신은 해결책이 있습니다. 응답 해 주셔서 감사합니다. – korvinko