csabo

Error retrieving Designer view with sender account in package

0 votes
I'm trying to load the classic Ui designer view in an iFrame. I have changed the way I'm creating the package to include a sender account. Below is the code I'm using to create the sender account and the package.
  string senderAccount = companyId.ToString() + "SENDER" + updateApproval.createUserId.ToString() + "@esl.boardbookit.com";
 AccountMember member = AccountMemberBuilder.NewAccountMember(senderAccount)
                        .WithFirstName(companyUserProfileModel.firstName)
                        .WithLastName(companyUserProfileModel.lastName)
                        .WithCompany(companyUserProfileModel.companyName)
                        .WithStatus(SenderStatus.ACTIVE)
                        .Build();

              Sender    senderMember = eslClient.AccountService.InviteUser(member);
 DocumentPackage newPackage = PackageBuilder
                    .NewPackageNamed(updateApproval.name)
                    .WithSenderInfo(SenderInfoBuilder.NewSenderInfo(senderMember.Email))
                    .WithSettings(DocumentPackageSettingsBuilder.NewDocumentPackageSettings()
                            .WithoutInPerson()
                            .WithoutLanguageDropDown()
                            .HideOwnerInPersonDropDown()
                            .WithoutWatermark()
                            .WithoutDocumentToolbarDownloadButton()
                            .WithoutDialogOnComplete()
                            .WithoutOptOut()
                            .WithoutOptOutOther()
                            .WithoutLanguageDropDown()
                            .WithCeremonyLayoutSettings(CeremonyLayoutSettingsBuilder.NewCeremonyLayoutSettings()
                                    .WithoutNavigator()
                                    .WithoutGlobalNavigation()
                                    .WithoutBreadCrumbs()
                                    .WithoutSessionBar()
                                    .WithProgressBar()
                                    .WithoutTitle()
                                    .WithIFrame()
                                    .WithoutGlobalConfirmButton()
                                    .WithoutGlobalDownloadButton()
                                    .WithoutGlobalSaveAsLayoutButton()
                                    ))
                            .WithAttributes(new DocumentPackageAttributesBuilder().WithAttribute("declined", false))
                    .Build();

                PackageId package = eslClient.CreatePackage(newPackage);
When I go to create the designer url, I either get an error saying the package is not accessible or the screen shot attached about cookies. Can you tell me how to generate the designer URL in the classic view for the sender that created the package? This person needs to be able to modify the package in the designer view. I'm tried every combination of getting the authentication token and building the designer url via the sdk and manually, but still no luck. I'm using https://sandbox.e-signlive.com/api to access the classic UI in my URLs. Thank you, Colleen

Attachments
Approved Answer

Reply to: Error retrieving Designer view with sender account in package

0 votes
The code you shared in your original post is fine as is in the sense that there no need to check if that person is already a sender in your account. If you send an invite to a sender to your account, he/she will not receive an email notification from eSignLive. Of course, if he/she is not a sender in your account, then an email notification is sent. If you want to check if the person is already a sender in your account, you can always query your account for a list of senders. You could do something like:
Boolean check = false;

IDictionary senders = eslClient.AccountService.GetSenders(Direction.ASCENDING, new PageRequest(1, 50)); //this will retrieve the first 50 senders in your account. If you have more than 50 senders, then you will need to create a loop and update the index after every 50 senders (e.g. the next 50 senders would be PageRequest(51, 50))

foreach (KeyValuePair x in senders)
{
        if (x.Key == senderMember.Email)
        {
               check = true;
        }
}

if (!check)
{
     //invite user
} else {
     //anything
}
Haris Haidary OneSpan Technical Consultant

Reply to: Error retrieving Designer view with sender account in package

0 votes
Hi Colleen, To create a session for your sender, you can use the authentication client to do so and embed the url in your iframe, as shown below (after creating your package):
string userAuthenticationToken = eslClient.AuthenticationTokenService.CreateSenderAuthenticationToken(packageId);
AuthenticationClient authenticationClient = new AuthenticationClient("https://sandbox.e-signlive.com");
string urlToDesigner = authenticationClient.BuildRedirectToPackageViewForSender(userAuthenticationToken, packageId);
If you are getting the cookie error, make sure third-party cookies is enabled in order for the esignlive designer view to load correctly inside the iframe. Let me know if it works for you.
Haris Haidary OneSpan Technical Consultant

Reply to: Error retrieving Designer view with sender account in package

0 votes
After changing the build redirect link to BuildRedirectToDesignerForSender, I was able to see the designer view. I was missing the creation of the authentication client in my code. This is working now. Thank you for the quick response. Colleen

Reply to: Error retrieving Designer view with sender account in package

0 votes
My pleasure. Let me know if you have any more questions =]
Haris Haidary OneSpan Technical Consultant

Reply to: Error retrieving Designer view with sender account in package

0 votes
Can you tell me what version of the SDK I should be using to access the classic UI? I have version 10.3 and 11.0. Thanks Colleen

Reply to: Error retrieving Designer view with sender account in package

0 votes
You should always be using, if possible, the latest release of the SDKs for each instance. For the classic ui, the latest version of the SDK is 10.13: http://docs.e-signlive.com/10.0/sdk/esl-sdk-net-10.13.zip. As for the new ui, the latest release is 11.0, which you already have.
Haris Haidary OneSpan Technical Consultant

Reply to: Error retrieving Designer view with sender account in package

0 votes
I have another question about the senders. If I created one already, how do I check to see if they exist? I don't want to add a sender every time I create a package. I only want to add a new one if one doesn't already exist. Or is this handled on your side when the InviteUser method is called? Thanks Colleen

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off