function getTransactionAPIProxy($user = null, $password = null) { global $IntegratorsKey, $api_wsdl, $api_options; if ($user === null && isset($_SESSION["UserID"])) { $user = $_SESSION["UserID"]; } if ($password === null && isset($_SESSION["Password"])) { $password = $_SESSION["Password"]; } $api = new APIService($api_wsdl, $api_options); // set credentials on the api object - if we have an integrator key then we prepend that to the UserID if (isset($IntegratorsKey) && $IntegratorsKey != "") { $api->setCredentials("[" . $IntegratorsKey . "]" . $user, $password); } else { $api->setCredentials($user, $password); } return $api; }
function getTransactionAPIProxy($user = null, $password = null) { global $IntegratorsKey, $api_wsdl, $api_options; if ($user === null && isset($_SESSION["UserID"])) { $user = $_SESSION["UserID"]; } if ($password === null && isset($_SESSION["Password"])) { $password = $_SESSION["Password"]; } // get Integrator Key from credentials.ini $ini_array = parse_ini_file("integrator.php"); $IntegratorsKey = $ini_array["IntegratorsKey"]; if (!isset($IntegratorsKey) || $IntegratorsKey == "") { $_SESSION["errorMessage"] = "Please make sure integrator key is set (in integrator.php)."; header("Location: error.php"); die; } $api = new APIService($api_wsdl, $api_options); // set credentials on the api object - if we have an integrator key then we prepend that to the UserID $api->setCredentials("[" . $IntegratorsKey . "]" . $user, $password); return $api; }
include_once "include/creds.php"; //============================================================================= // helper constants //============================================================================= // TODO: put in a test recipient email $_apiRecipient1Email = ""; // TODO: put in users name $_apiUserName = ""; //============================================================================= // Set up the API //============================================================================= $_apiEndpoint = "https://demo.docusign.net/api/3.0/api.asmx"; $_apiWsdl = "api/APIService.wsdl"; $api_options = array('location' => $_apiEndpoint, 'trace' => true, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS); $api = new APIService($_apiWsdl, $api_options); $api->setCredentials("[" . $IntegratorsKey . "]" . $UserID, $Password); //============================================================================= // helper functions //============================================================================= /** * Creates one signer recipient * @return array of one Recipient */ function createOneSigner() { global $_apiRecipient1Email; $rcp1 = new Recipient(); // First recipient to put in recipient array $rcp1->UserName = "******"; $rcp1->Email = $_apiRecipient1Email; $rcp1->Type = RecipientTypeCode::Signer;
include "api/CredentialService.php"; // api service proxy classes and soapclient include "api/APIService.php"; // redirect to setup page if we aren't logged in loginCheck("../login.php"); // get Integrator Key from credentials.ini $ini_array = parse_ini_file("integrator.php"); $IntegratorsKey = $ini_array["IntegratorsKey"]; // setup api connection $api_endpoint = "https://demo.docusign.net/api/3.0/api.asmx"; $api_wsdl = "api/APIService.wsdl"; $api_options = array('location' => $api_endpoint, 'trace' => true, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS); $api = new APIService($api_wsdl, $api_options); // set credentials on the api object - if we have an integrator key then we prepend that to the UserID if (isset($IntegratorsKey) && $IntegratorsKey != "") { $api->setCredentials($IntegratorsKey . $_SESSION["UserID"], $_SESSION["Password"]); } else { $api->setCredentials($_SESSION["UserID"], $_SESSION["Password"]); } $RequestStatusesParams = new RequestStatuses(); /* $RequestStatusesParams->EnvelopeStatusFilter->UserInfo->UserName = $_SESSION["UserName"]; $RequestStatusesParams->EnvelopeStatusFilter->UserInfo->Email = $_SESSION["Email"]; $RequestStatusesParams->EnvelopeStatusFilter->AccountId = $_SESSION["AccountID"]; $RequestStatusesParams->EnvelopeStatusFilter->Statuses->Status = "Any"; */ $RequestStatusParams = new RequestStatus(); $RequestStatusParams->EnvelopeID = $_SESSION["EnvelopeID"]; try { $RequestStatusResponse = $api->RequestStatus($RequestStatusParams); addToLog("API Call - RequestStatus Request", '<pre>' . xmlpp($api->_lastRequest, true) . '</pre>');
$_SESSION["AccountID"] = $APIAccountID; $_SESSION["Password"] = $password; $_SESSION["APIHost"] = $APIHost; if ($IntegratorsKey != "") { $_SESSION["IntegratorsKey"] = $IntegratorsKey; } $_SESSION["CredentialsSet"] = true; } // setup api connection $api_endpoint = $_SESSION["APIHost"] . "/api/3.0/api.asmx"; $api_wsdl = "api/APIService.wsdl"; $api_options = array('location' => $api_endpoint, 'trace' => true, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS); $api = new APIService($api_wsdl, $api_options); // set credentials on the api object - if we have an integrator key then we prepend that to the UserID if (isset($_SESSION["IntegratorsKey"]) && $_SESSION["IntegratorsKey"] != "") { $api->setCredentials("[" . $_SESSION["IntegratorsKey"] . "]" . $_SESSION["UserID"], $_SESSION["Password"]); } else { $api->setCredentials($_SESSION["UserID"], $_SESSION["Password"]); } // functions // helper function to make tabs function MakeTab($docID, $recID, $PageNumber, $X = null, $Y = null, $Type, $Name = null, $TabLabel = null, $Value = null, $AnchorTabString = null, $AnchorXOffset = null, $AnchorYOffset = null) { $tab = new Tab(); $tab->DocumentID = $docID; $tab->RecipientID = $recID; $tab->PageNumber = $PageNumber; if (isset($X)) { $tab->XPosition = $X; } if (isset($Y)) {
/** * Gets APIService SOAP client proxy that uses SOAP header authentication * @return APIService */ function getAPI() { loginCheck(); global $api_endpoint; $api_wsdl = "api/APIService.wsdl"; $api_options = array('location' => $api_endpoint, 'trace' => true, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS); $api = new APIService($api_wsdl, $api_options); $api->setCredentials("[" . $_SESSION["IntegratorsKey"] . "]" . $_SESSION["UserID"], $_SESSION["Password"]); return $api; }
function getAPI() { global $api_endpoint; global $IntegratorsKey; global $UserID; global $Password; $api_wsdl = "api/APIService.wsdl"; $api_options = array('location'=>$api_endpoint,'trace'=>true,'features' => SOAP_SINGLE_ELEMENT_ARRAYS); $api = new APIService($api_wsdl, $api_options); $api->setCredentials("[" . $IntegratorsKey . "]" . $UserID, $Password); return $api; }