This topic contains 1 reply, has 2 voices, and was last updated by  Duo_Liang 1 week, 5 days ago.

  • Author
    Posts
  • Participant
    mailtodanish
    Newbie
    Member since: 20.11.2017
    Number of posts: 16

    we are receiving below notofication.

    {“@class”:”com.silanis.esl.packages.event.ESLProcessEvent”,”name”:”SIGNER_COMPLETE”,”sessionUser”:”WvkDSx1Y7TwJ”,”packageId”:”ZDpPk7usBE9clU9SHp_PllOB6As=”,”message”:null,”documentId”:null,”createdDate”:”2019-01-01T12:04:28.213Z”}

    We want to get Signer Name from sessionUser and document name from documentId.

    Keymaster
    Duo_Liang
    Guru
    Member since: 14.06.2018
    Number of posts: 608

    Score

    0

    Hi there,

    Here’s some sample code for you:

    		String packageId = "";
    		String sessionUser = "";
    		String documentId = "";
    		
    		com.silanis.esl.api.model.Package apiPackage = eslClient.getPackageService().getApiPackage(packageId);
    		
    		String documentName = null;
    		for (com.silanis.esl.api.model.Document document : apiPackage.getDocuments()) {
    			if(document.getId().equals(documentId)) {
    				documentName = document.getName();
    				break;
    			}
    		}
    		
    		
    		String signerName = null;
    		for (com.silanis.esl.api.model.Role role : apiPackage.getRoles()) {
    			com.silanis.esl.api.model.Signer signer = role.getSigners().get(0);
    			if(signer.getId().equals(sessionUser)) {
    				signerName = signer.getFirstName() + " " + signer.getLastName();
                                    break;
    			}
    		}
    		
    		System.out.println("document name: " + documentName);
    		System.out.println("signer name: " + signerName);

    Few things to notice:
    1.sessionUser here is signer ID of the signer, which is only exposed from com.silanis.esl.api.model.Package (not com.silanis.esl.sdk.model.Package in most cases)
    2.the callback event sending you this notification was “Recipient completed signing”, which was not specified to a single document, that’s why the payload says “documentId=null”, but the sample code works when documentId is not null.

    Hope this could help!
    Duo


    Duo Liang
    OneSpan Junior Technical Evangelist
    • This reply was modified 1 week, 5 days ago by  Duo_Liang.

You must be logged in to reply to this topic.