nehme | Posts: 153

CallBack

0 votes
Hello, I am trying to know more about the CallBack URL and notification related for this. Can you please share sample codes C#. To leran more how to use this feature in your system. Thanks, Nehme

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, With callback URL set in your account, every time when an event happens (i.e. transaction completed, attachment uploaded, etc.), OneSpan Sign will send a notification in the form of an HTTP POST request to your registered URL. Following are some examples of the payload in the HTTP POST request OSS would send to you(not complete but includes common events):
Create a new Package:
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"PACKAGE_CREATE","sessionUser":"18EZDL44xgsX","packageId":"wVdZEaPD2igwUnFGJBjDD0dpO7k=","message":null,"documentId":null,"createdDate":"2018-06-30T20:04:55.384Z"}

Send a package
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"PACKAGE_ACTIVATE","sessionUser":"18EZDL44xgsX","packageId":"5n4obeO8jYoPp126Cm-Y3fxdfbo=","message":null,"documentId":null,"createdDate":"2018-06-30T20:09:50.425Z"}

Signer 1 accept consent document
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"DOCUMENT_SIGNED","sessionUser":"44aafb7c-97b9-40e1-bb59-eb76c7d2a484","packageId":"5n4obeO8jYoPp126Cm-Y3fxdfbo=","message":null,"documentId":"default-consent","createdDate":"2018-06-30T20:10:51.002Z"}

Signer 1 sign a signature block
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"DOCUMENT_SIGNED","sessionUser":"44aafb7c-97b9-40e1-bb59-eb76c7d2a484","packageId":"5n4obeO8jYoPp126Cm-Y3fxdfbo=","message":null,"documentId":"7caf46cdd75f7a411bf8c22793b84fa79d8d180becc40691","createdDate":"2018-06-30T20:12:12.256Z"}

Signer 1 finish his part
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"SIGNER_COMPLETE","sessionUser":"44aafb7c-97b9-40e1-bb59-eb76c7d2a484","packageId":"5n4obeO8jYoPp126Cm-Y3fxdfbo=","message":null,"documentId":null,"createdDate":"2018-06-30T20:12:12.272Z"}

Package Complete:
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"PACKAGE_COMPLETE","sessionUser":"e00696ec-d6f5-4feb-89c5-a5ce002a6c66","packageId":"5n4obeO8jYoPp126Cm-Y3fxdfbo=","message":null,"documentId":null,"createdDate":"2018-06-30T20:15:01.038Z"}

Signer 1 opt out:
{"@class":"com.silanis.esl.packages.event.ESLProcessEvent","name":"PACKAGE_OPT_OUT","sessionUser":"b5381b13-991e-4179-9f9b-d4e1ec9d06bb","packageId":"J5tyJalzG49hmDho5b9JdG61T7M=","message":"the personal info is not correct","documentId":null,"createdDate":"2018-06-30T20:16:29.763Z"}
You'd need a public IP address to monitor the callbacks and deal with the request body to fit your own business logic. This blog will show you how to Creating a ASP.NET MVC Web Application And this blog will show you how to Creating a Callback Event Notification Listener with Controller Hope this could help you! Duo

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello, Thanks for your details. So it mean I have to have a logic while using callbackurl to handle the callbacks and deal with the request body from your side. Kindly, can you share some more details how to create a interface from my side to handle your callbacks and request. Thanks

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, Sure, this simple example code in our code share which shows you how to listen for the "PACKAGE_COMPLETE" event notification and subsequently download the signed documents using the package id in the notification using the eSignLive .NET SDK. I think you will interested in these codes in the example which shows you how to read request body from Http Request:
// Get the received request's headers
var requestheaders = HttpContext.Request.Headers;

// Get the received request's body
var requestBody = string.Empty;
using (var reader = new System.IO.StreamReader(HttpContext.Request.InputStream))
{
       requestBody = reader.ReadToEnd();
}

JObject jsonBody = JObject.Parse(requestBody);

//Do anything you want with the json payload from esignlive
Debug.WriteLine(jsonBody);

string packageId = jsonBody["packageId"].ToString();
Duo

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello Duo, I want to check about the callback. Is there any way to get all the injected fields data back by using CallBack? For example, I have a field with a unbound_text, if the client update the feild data than signed the document, how i can catch all the changes done to fields data by using callback URL? Thanks Nehme

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, Just to make sure with you, you are talking about the injected fields when creating the package or fields like textfield which signers can modify when signing ceremony? Duo

nehme | Posts: 153

Reply to: CallBack

0 votes
Hi Duo, yes this is what I am talking about and get details how to get the changes. Thanks

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, If you mean during signing ceremony, your signer will only insert information instead of signing any document, there won't be trigger event for this and therefore you can't receive a callback. So can I ask for the use case for this scenario and then we can try to find a workaround. Duo

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello Duo, I just want to get back the changes happened inside the document. For example if I have a text field, the user has the facility to change the text inside this field before signing, so how I can catch these fields changes for the document. Thanks

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, So can your workflow allow to wait until the signer finish the document(not necessary the whole package)? Because the only callback event related to this is "Document Signed" or "Recipient Completed Signing". In this way, you can retrieve the packageId, role Id, document Id of this event and allows you to make a SDK call to grab the text fields value. Duo

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello Duo, Yes this is what I want. After the signer finish signing document(s). That's the main logic for us is to grab all the text fields value after the signing ceremony is finished. Thanks, Nehme

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello Duo, Any update about the issue i have post. Thanks! Nehme

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, Sorry for the late reply. Do you want me to create some snippets for you on this use case? Duo

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello Duo, Yes Please using SDK C#. THANKS! Nehme

nehme | Posts: 153

Reply to: CallBack

0 votes
Hello Duo, Any update about the snippets you will provide me for this issue. Thanks, Nehme

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, Sorry for the late reply, the code is almost done. Just one question for you, did you assign a .WithCustomId("Signer")) function to identify your role Id && signer Id? Duo

Duo_Liang | Posts: 3776

Reply to: CallBack

0 votes
Hi nehme, If you currently set CustomId(), the attachment code should work for you. It's a simple ASP .NET Web Application, and these are the additional files: |---Contollers---NotifyControllers.cs |--Models---ESLNotificationCallbackInfo.cs |---Services---ESLNotificationHandler.cs |---Utils---Constants.cs And the function is to realize, when receiving "DOCUMENT_SIGNED" event, grab the key and value for injected fields this recipient has filled in. The only limitation is, your signer id and role id need to be the same which means you need to assign CustomId() function when creating package. Duo

Attachments
10_1_1.zip3.52 KB

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