Created
February 16, 2018 05:04
-
-
Save DSDevCenter/74c07d44c9fadfcd3769d6511215255f to your computer and use it in GitHub Desktop.
SOAP API Example - Embedded Signing PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Construct the recipient token authentication assertion and specify | |
// ID, start time, method, and domain | |
$assertion = new RequestRecipientTokenAuthenticationAssertion(); | |
$assertion->AssertionID = guid(); | |
$assertion->AuthenticationInstant = nowXsdDate(); | |
$assertion->AuthenticationMethod = RequestRecipientTokenAuthenticationAssertionAuthenticationMethod::Password; | |
$assertion->SecurityDomain = "Request Recipient Token Test"; | |
// Construct the URLs based on UserName | |
$recip = $env->Recipients[0]; | |
$urls = new RequestRecipientTokenClientURLs(); | |
$urlbase = "https://127.0.0.1/"; | |
$urls->OnSigningComplete = $urlbase . "?event=SignComplete&uname=" . $recip->UserName; | |
$urls->OnViewingComplete = $urlbase . "?event=ViewComplete&uname=" . $recip->UserName; | |
$urls->OnCancel = $urlbase . "?event=Cancel&uname=" . $recip->UserName; | |
$urls->OnDecline = $urlbase . "?event=Decline&uname=" . $recip->UserName; | |
$urls->OnSessionTimeout = $urlbase . "?event=Timeout&uname=" . $recip->UserName; | |
$urls->OnTTLExpired = $urlbase . "?event=TTLExpired&uname=" . $recip->UserName; | |
$urls->OnIdCheckFailed = $urlbase . "?event=IDCheck&uname=" . $recip->UserName; | |
$urls->OnAccessCodeFailed = $urlbase . "?event=AccesssCode&uname=" . $recip->UserName; | |
$urls->OnException = $urlbase . "?event=Exception&uname=" . $recip->UserName; | |
// Send | |
$requestRecipientTokenparams = new RequestRecipientToken(); | |
$requestRecipientTokenparams->EnvelopeID = $createResult->EnvelopeID; | |
$requestRecipientTokenparams->ClientUserID = $recip->CaptiveInfo->ClientUserID; | |
$requestRecipientTokenparams->Username = $recip->UserName; | |
$requestRecipientTokenparams->Email = $recip->Email; | |
$requestRecipientTokenparams->AuthenticationAssertion = $assertion; | |
$requestRecipientTokenparams->ClientURLs = $urls; | |
$response = $api->RequestRecipientToken($requestRecipientTokenparams); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment