csabo | Posts: 40

Need help with getSigningUrl

0 votes
I have some questions about creating the signing url in the .Net SDK and the REST API. Here is what I have so far. I've created a package called "Test". I've added documents to Test. I've added Signers with just firstname, lastname and emailaddress to Test. I want to store the SignerId in my database, which I see that I can retrieve by using this:
string signerId = eslClient.GetPackage(pkgId).GetSigner(emailaddress).Id;
. So far, so good. In our application, the user will then be shown the designer view in an iFrame to add the signers and signing types to the documents. Then they will click a "send" button on our site. I'll retrieve the Test package, change the package status to "sent" in your system, and then determine which signers need the email and create the signing URL. What information do I need to use to create the signing URL? The SDK has a method that uses the packageId and the signerId. But, our moblie developer pointed out that the REST API uses a roleId. So, is the roleId and the signerId the same thing? If not, where do I get the roleId from and what is it associated to? Thank you, Colleen

mwilliams | Posts: 957

Reply to: Need help with getSigningUrl

0 votes
Not sure I know exactly where your question starts, but I'll assume you've got everything up until you need to create a signing session. If that's not the case, let me know, but I'll start there. You have two ways to get a signing session. One is to get the URL where you need to actually have the signerId like you're getting above:
eslClient.PackageService.GetSigningUrl(packageId, signerId)
There is also the sessionToken that you would get and use in the URL sandbox.e-signlive.com/access?sessionToken={sessionToken}, where you'd get the sessionToken with:
eslClient.SessionService.CreateSignerSessionToken(packageId, "[email protected]")
With the REST API, you could do like the second option I showed above and simply use the email address to get the sessionToken with a POST request to sandbox.e-signlive.com/api/signerAuthenticationToken with JSON Payload:
{
   "packageId":"{packageId}",
   "signerId":"[email protected]",
   "value":""
}
The response payload would be the same as the request payload except the value would have the sessionToken in it to be used in the url sandbox.e-signlive.com/access?sessionToken={sessionToken} If you want to do the GET request for the signing URL, you do need to get the role ID which can be found by grabbing the roles for the package and locating the appropriate roleId. You can see more about this request in the documentation: http://docs.e-signlive.com/doku.php?id=esl:api:e-signlive_roles#get_packages_packageid_roles Hope this helps. Let me know.

csabo | Posts: 40

Reply to: Need help with getSigningUrl

0 votes
Michael, The information you provided helps. Our mobile developer would like to use the REST Get call and would like me to store the RoleId in the database it if possible. So, I would need to make a call to get roles and then associate the roleId to what object? (ie, package, signer, document) I just tried calling
eslClient.PackageService.GetSigningUrl(packageId, signerId)
on a sent package, and I get this an object reference error below. Silanis.ESL.SDK.EslException was unhandled by user code HResult=-2146233088 Message=Could not get a signing url. Exception: Object reference not set to an instance of an object. Source=Silanis.ESL StackTrace: at Silanis.ESL.SDK.Services.PackageService.GetSigningUrl(PackageId packageId, Role role) at Silanis.ESL.SDK.Services.PackageService.GetSigningUrl(PackageId packageId, String signerId) at TestESignLiveMVC.Controllers.HomeController.SignApproval() in c:\Users\Colleen\Documents\Visual Studio 2013\Projects\TestESignLiveMVC\TestESignLiveMVC\Controllers\HomeController.cs:line 71 at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.ActionInvocation.InvokeSynchronousActionMethod() at System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.>c__DisplayClass46.b__3f() InnerException: System.NullReferenceException HResult=-2147467261 Message=Object reference not set to an instance of an object. Source=Silanis.ESL StackTrace: at Silanis.ESL.SDK.Services.PackageService.GetSigningUrl(PackageId packageId, Role role) InnerException Please advise. Thank you, Colleen

mwilliams | Posts: 957

Reply to: Need help with getSigningUrl

0 votes
Did you pass the signer ID or the email address? To that one, you have to have the signerId string like you were getting in your initial post. Let me know.

csabo | Posts: 40

Reply to: Need help with getSigningUrl

0 votes
Michael, Here is the code I used when I got that error. I retrieved the signer and then referenced the id property.
            PackageId packageId = new PackageId("e037d16d-6594-4344-b62d-d0de0d123457");
            Signer sName = eslClient.GetPackage(packageId).GetSigner("[email protected]");
            string sUrl = eslClient.PackageService.GetSigningUrl(packageId, sName.Id);
Thank you, Colleen

mwilliams | Posts: 957

Reply to: Need help with getSigningUrl

0 votes
I have no problem when doing this:
string mySigner = eslClient.GetPackage(packageId).GetSigner("[email protected]").Id;
string myURL = eslClient.PackageService.GetSigningUrl(packageId, mySigner);

mwilliams | Posts: 957

Reply to: Need help with getSigningUrl

0 votes
What version of the SDK are you using, btw?

csabo | Posts: 40

Reply to: Need help with getSigningUrl

0 votes
Michael, Let's go back a step. When I'm adding signers to the package, I'm using the following code. When this signer is added to your system, does it automatically generate a roleId? If so, how do I see it so that I can store it in our database?
Signer signer = SignerBuilder.NewSignerWithEmail(au.emailAddress)
                        .WithFirstName(au.firstName)
                        .WithLastName(au.lastName)
                        .SigningOrder(au.sortOrder)
                        .Build();

                    eslClient.PackageService.AddSigner(pkgId, signer);

                    string signerId = eslClient.GetPackage(pkgId).GetSigner(au.emailAddress).Id;
Thank you, Colleen

mwilliams | Posts: 957

Reply to: Need help with getSigningUrl

0 votes
Alright. How about trying this: When you create your package with the .NET SDK and you add your signer, give the signer a customId like this:
.WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                .WithFirstName("Michael")
                                .WithLastName("Williams")
                                .WithCustomId("MySigner1"))
Then, when you're using REST, you can do a GET call to:
https://sandbox.e-signlive.com/api/packages/{packageId}/roles/MySigner1/signingUrl
This way, you don't have to find the Id anywhere. You created the ID in your code. The same will work for your SDK code:
string myURL = eslClient.PackageService.GetSigningUrl(packageId, "MySigner1");

csabo | Posts: 40

Reply to: Need help with getSigningUrl

0 votes
Michael, I am using SDK version 10.13.0.0. If I use a customId, does that show up in the designer view anywhere or is it just a behind the scenes value? We are showing the designer view to our users for them to add the signers to the documents. I just want to make sure it doesn't show in that view. I'll give the customId a try. Thanks Colleen

mwilliams | Posts: 957

Reply to: Need help with getSigningUrl

0 votes
No. It shouldn't show up in the designer session anywhere. Let me know if you notice it anywhere, but I don't see it.

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