@@ -51,18 +51,15 @@ public static bool IsCFRPart11Account(string accessToken, string basePath, strin
5151 public static string EmbeddedSigning ( string signerEmail , string signerName , string accessToken , string basePath , string accountId , string countryAreaCode , string phoneNumber , string docPdf , string redirectUrl )
5252 {
5353 // Construct your API headers
54- // Step 2 start
54+ //ds-snippet- start:eSign41Step2
5555 var docuSignClient = new DocuSignClient ( basePath ) ;
5656 docuSignClient . Configuration . DefaultHeader . Add ( "Authorization" , "Bearer " + accessToken ) ;
5757
58- // Step 2 end
59-
60- // Step 3 start
6158 var accountsApi = new AccountsApi ( docuSignClient ) ;
6259 AccountIdentityVerificationResponse response = accountsApi . GetAccountIdentityVerification ( accountId ) ;
6360 var phoneAuthWorkflow = response . IdentityVerification . FirstOrDefault ( x => x . DefaultName == "SMS for access & signatures" ) ;
61+ //ds-snippet-end:eSign41Step2
6462
65- // Step 3 end
6663 if ( phoneAuthWorkflow == null )
6764 {
6865 throw new ApiException ( 0 , "IDENTITY_WORKFLOW_INVALID_ID" ) ;
@@ -71,7 +68,7 @@ public static string EmbeddedSigning(string signerEmail, string signerName, stri
7168 string workflowId = phoneAuthWorkflow . WorkflowId ;
7269
7370 // Construct your envelope JSON body
74- // Step 4 start
71+ //ds-snippet- start:eSign41Step3
7572 EnvelopeDefinition env = new EnvelopeDefinition ( )
7673 {
7774 EnvelopeIdStamping = "true" ,
@@ -144,23 +141,27 @@ public static string EmbeddedSigning(string signerEmail, string signerName, stri
144141 Recipients recipients = new Recipients ( ) ;
145142 recipients . Signers = new List < Signer > { signer1 } ;
146143 env . Recipients = recipients ;
147-
148- // Step 4 end
144+ //ds-snippet-end:eSign41Step3
149145
150146 // Call the eSignature REST API
151- // Step 5 start
147+ //ds-snippet- start:eSign41Step4
152148 EnvelopesApi envelopesApi = new EnvelopesApi ( docuSignClient ) ;
153149 EnvelopeSummary results = envelopesApi . CreateEnvelope ( accountId , env ) ;
150+ //ds-snippet-end:eSign41Step4
154151
155- // Step 5 end
152+ //ds-snippet-start:eSign41Step5
156153 RecipientViewRequest viewRequest = MakeRecipientViewRequest ( signerEmail , signerName , redirectUrl , _clientUserId ) ;
154+ //ds-snippet-end:eSign41Step5
157155
158156 // call the CreateRecipientView API
157+ //ds-snippet-start:eSign41Step6
159158 ViewUrl results1 = envelopesApi . CreateRecipientView ( accountId , results . EnvelopeId , viewRequest ) ;
159+ //ds-snippet-end:eSign41Step6
160160
161161 return results1 . Url ;
162162 }
163163
164+ //ds-snippet-start:eSign41Step5
164165 private static RecipientViewRequest MakeRecipientViewRequest ( string signerEmail , string signerName , string returnUrl , string signerClientId , string pingUrl = null )
165166 {
166167 // Data for this method
@@ -206,5 +207,6 @@ private static RecipientViewRequest MakeRecipientViewRequest(string signerEmail,
206207
207208 return viewRequest ;
208209 }
210+ //ds-snippet-end:eSign41Step5
209211 }
210212}
0 commit comments