Account


Earned badges

Achievement: Latest Unlocked

Topic Started

This user has not created any forum posts.

Replies Created

Reply to: Allowing signer to upload a signature through apex sdk

0 votes

Hi Duo,

 

Appreciate your response, but the link you shared is to add documents to transaction.

I am asking to add a configuration so we allow user to upload signature file while signing rather than drawing the signature. How do we do that via code?

On User Interface: you click on signature block and toggle "from file".

Thanks

Akshay


Reply to: Allowing signer to upload a signature through apex sdk

0 votes

HI Dua, it does not work. This is what i tried.

Even after updating the package and setting fromFile=true. it does not update on package.

    pkg = sdk.getPackage(packageId);

    for(OneSpanAPIObjects.Document doc : pkg.documents){

        for(OneSpanAPIObjects.Approval aprvl : doc.approvals){

            if(fileSignerRoleId==aprvl.role) aprvl.fromFile=true;

        }

     }

sdk.updatePackage(pkg, packageId);


Approved Answer

Reply to: Allowing signer to upload a signature through apex sdk

0 votes

Hi Duo,

I tried that too yesterday, it gives an internal error. Here is the code.

 

pkg = sdk.getPackage(packageId);

    for(OneSpanAPIObjects.Document doc : pkg.documents){

        for(OneSpanAPIObjects.Approval aprvl : doc.approvals){

            if(fileSignerRoleId==aprvl.role) {

                aprvl.fromFile=true;

                sdk.updateApproval(packageId, doc.Id, aprvl.id, aprvl);

            }

        }

     }

Package ID: 7DnYwrl91MyzxyFQo--RbngRLNs=
User: [email protected]


Reply to: Allowing signer to upload a signature through apex sdk

0 votes

Again Error is thrown even after making it as draft.

OneSpanRESTAPIHelper.OneSpanRestAPIHelperException: Error creating OneSpan signer: 500 - Internal Server Error - {"messageKey":"error.internal.default","message":"Unexpected error. We apologize for any inconvenience this may have caused you, please try again. If the problem persists, please contact our support team.","code":500,"name":"Unhandled Server Error"}

 

I cannot create a new package with fromFile=true. Reason being, we add our tags to the document itself and send for package generation. Tags do not have any attribute to mark it from file.

{{esl:Signer1:Capture:Size(120,30)}}

Let me know what can be done in this case.


Reply to: Allowing signer to upload a signature through apex sdk

0 votes

I was able to update it using below code.

                    pkg = sdk.getPackage(packageId);

                    for(OneSpanAPIObjects.Document doc : pkg.documents){

                        if((String.valueOf(fileId)).equalsIgnoreCase(doc.id)){

//fileid is the document you used to generate the onespan package.

//if you try changing it for default-consent document, it will give error

                            for(OneSpanAPIObjects.Approval aprvl : doc.approvals){

                                if(signerRoleId==aprvl.role) {

                                    aprvl.fromFile=true;

                                    sdk.updateApproval(packageId, doc.Id, aprvl.id, aprvl);

                                }

                            }

                        }

                    }


Subscriptions

This user is not subscribed to any release notes.

Code Share

This user has not submitted any code shares.

Subscriptions Release Notes

This user is not subscribed to any release notes.