clara

Unable to retrieve signatures

0 votes
Hello, We are trying to determine which signatures have been signed with the following method:
eslClient.getApprovalService().getAllSignableSignatures(documentPackage, documentId, signerId)
however we get the following error:
Optional details: {"code":403,"messageKey":"error.forbidden.gettingOtherSignatures","message":"You can only get signatures for your own signer.","name":"Access Denied"}
	at com.silanis.esl.sdk.internal.RestClient.execute(RestClient.java:199) ~[sdk-11.18.jar:?]
	at com.silanis.esl.sdk.internal.RestClient.get(RestClient.java:305) ~[sdk-11.18.jar:?]
	at com.silanis.esl.sdk.internal.RestClient.get(RestClient.java:297) ~[sdk-11.18.jar:?]
	at com.silanis.esl.sdk.service.apiclient.ApprovalApiClient.getAllSignableApprovals(ApprovalApiClient.java:188) ~[sdk-11.18.jar:?]
	at com.silanis.esl.sdk.service.ApprovalService.getAllSignableSignatures(ApprovalService.java:142) ~[sdk-11.18.jar:?]
Pretty sure we are passing in the correct parameters as when we go to the following link after we login, a JSON response can be found:
https://sandbox.e-signlive.ca/api/packages/{packageId}/documents/{documentId}/signers/{signerId}/approvals
Is this the correct way to determine which signatures have been signed / still outstanding? Thanks!

Approved Answer

Reply to: Unable to retrieve signatures

0 votes
Hey Clara, Yes, getAllSignableSignatures() function internally invokes the API call you mentioned above, so theoretically the behavior should be consistent in browser and in SDK. Could you double check that the API Key you are using is associated to the user you logged in web portal? And you could already try using signer email instead of signer ID. In terms of how to determine which signatures have been signed/outstanding, you could tell from "accepted" or "signed" attribute, if there's a date instead of null means the signer has already sigend. (in SDK, seems only accepted date get injected) And because this bit of info is contained in package metadata, you don't need to query separately, below is the sample code to achieve such a goal:
		DocumentPackage package1 = eslClient.getPackage(new PackageId("gQxS8Zgr_hGrmauGv3tnubbHfYU="));	
		Document document = package1.getDocument(document_name);	
		for (Signature signature : document.getSignatures()) {
			if(signature.getSignerEmail().equals(signer_email)) {
				if(signature.getAccepted() != null) {
					System.out.println(signer_email + " signed " + signature.getId() + " at " + signature.getAccepted());
				}
			}
		}
Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: Unable to retrieve signatures

0 votes
We didn't realize one could access the signatures from the package metadata, which is what we needed. Thank you for the quick reply, Duo!

Reply to: Unable to retrieve signatures

0 votes
Glad to help! Feel free to ask any other questions. :)

Duo Liang OneSpan Evangelism and Partner Integrations Developer


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