I am using the code from the Code Recipes for Embedded signing but converted from C# to VB.NET, the code uses the Docusign API Nuget. The CreateEnvelope returns a USER_LACKS_PERMISSIONS. I have gone through my permissions and checked everything. The user I am logging in with is an Account Administrator and seems to have all permissions checked. I am setting the Recipient Email to the actual recipient email (different from my administrator account) even though it's embedded signing, I don't know if that is the problem. I do want the actual signer to get a copy of the signed document which is why I am using the recipient email as the RecipientEmail.
Below is the code that causes the error:
Dim accountId As String
accountId = loginApi()
Dim envDef As New DocuSign.eSign.Model.EnvelopeDefinition()
envDef.EmailSubject = "TEST - Please sign this doc"
' Add a document to the envelope
Dim doc As New DocuSign.eSign.Model.Document()
doc.DocumentBase64 = System.Convert.ToBase64String(DocumentBytes)
doc.Name = "TestFile.pdf"
doc.DocumentId = "1"
envDef.Documents = New List(Of DocuSign.eSign.Model.Document)()
envDef.Documents.Add(doc)
' Add a recipient to sign the documeent
Dim signer As New DocuSign.eSign.Model.Signer()
signer.Email = recipientEmail
signer.Name = recipientName
signer.RecipientId = "1"
signer.ClientUserId = "1234"
' must set |clientUserId| to embed the recipient!
' Create a |SignHere| tab somewhere on the document for the recipient to sign
signer.Tabs = New DocuSign.eSign.Model.Tabs()
signer.Tabs.SignHereTabs = New List(Of DocuSign.eSign.Model.SignHere)()
Dim signHere As New DocuSign.eSign.Model.SignHere()
signHere.DocumentId = "1"
signHere.PageNumber = "1"
signHere.RecipientId = "1"
signHere.XPosition = "100"
signHere.YPosition = "100"
signer.Tabs.SignHereTabs.Add(signHere)
envDef.Recipients = New DocuSign.eSign.Model.Recipients()
envDef.Recipients.Signers = New List(Of DocuSign.eSign.Model.Signer)()
envDef.Recipients.Signers.Add(signer)
' set envelope status to "sent" to immediately send the signature request
envDef.Status = "sent"
' |EnvelopesApi| contains methods related to creating and sending Envelopes (aka signature requests)
Dim envelopesApi As New DocuSign.eSign.Api.EnvelopesApi()
Dim envelopeSummary As DocuSign.eSign.Model.EnvelopeSummary = envelopesApi.CreateEnvelope(accountId, envDef)
