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
August 23Created
January 21Last Updated
6 years agoLast Reply
16Replies
159Views
2Users
0Likes
0Links
Duo_Liang | Posts: 3776
Reply to: CallBack
Thursday, August 23, 2018 at 11:02am
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"}
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
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();
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
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
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
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
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
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
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
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
Reply to: CallBack
Thursday, August 23, 2018 at 11:02amReply to: CallBack
Friday, August 24, 2018 at 05:23amReply to: CallBack
Friday, August 24, 2018 at 05:36amReply to: CallBack
Tuesday, September 4, 2018 at 05:10amReply to: CallBack
Tuesday, September 4, 2018 at 09:29amReply to: CallBack
Tuesday, September 4, 2018 at 10:52amReply to: CallBack
Tuesday, September 4, 2018 at 11:31amReply to: CallBack
Tuesday, September 4, 2018 at 12:08pmReply to: CallBack
Tuesday, September 4, 2018 at 12:14pmReply to: CallBack
Wednesday, September 5, 2018 at 04:22amReply to: CallBack
Monday, September 10, 2018 at 05:13amReply to: CallBack
Monday, September 10, 2018 at 05:42amReply to: CallBack
Tuesday, September 11, 2018 at 06:28amReply to: CallBack
Monday, October 1, 2018 at 04:22amReply to: CallBack
Monday, October 1, 2018 at 08:01am.WithCustomId("Signer"))
function to identify your role Id && signer Id? DuoReply to: CallBack
Monday, October 1, 2018 at 10:00am