jortizclaver

documentSigningOrderViolation exception while retrieving a document

0 votes

During the development of a small PoC, we have hit an exception in one of the REST calls that we are not able to resolve. What we are trying to do is the following:

1. Clone an existing template with one document and signature configured.

2. With the new package still in DRAFT, add to new package a dynamically generated PDF

3. Retrieve the fields of the two documents and repopulate them (at this point, only the first document, the one that originally belong to the template will have).

4. Send the document to the customer.

It is at step 3, when trying to retrieve the details of document dynamically generated, where we are getting the error. The payload of the request is fairly simple:

------------------HTTP REQUEST CONTENTS------------------

GET /api/packages/CbfQPGIE-s9F2vZILZFeuoSVNo0=/documents/a5340e97c0251043d67384be1d85fe283a41b5c27ebc853d

Request Headers: {Accept=application/json;esl-api-version=11.0.3, Authorization=Basic dkNlxxxxxxxampjQw==, Content-Type=application/json}

------------------HTTP RESPONSE CONTENTS------------------

Response Message Data: 158 bytes received
{"messageKey":"error.forbidden.signing.documentSigningOrderViolation","message":"Document signing order has been violated.","code":403,"name":"Access Denied"}

Interestingly, when we retrieve the details of the template using the same credentials, we can see both documents without issues (attached payload). If we open the transaction (still in draft) from the OpenSpan console and click on Send, everything works fine as well. 

Any suggestion/comment will be highly appreciated. 


Reply to: documentSigningOrderViolation exception while retrieving a document

0 votes

Hi Jorge,

 

Is the issue reproducible? If so, could you create another transaction and stopped at the point when you failed to retrieve the second document JSON (GET /api/packages/{packageId}/documents/{documentId}) and share the package ID to me? Also, is it possible to adjust the flow and use get package JSON call (GET /api/packages/{packageId}) instead of retrieving two documents respectively?

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: documentSigningOrderViolation exception while retrieving a document

0 votes

Hi Duo,

I am not sure why it was failing but I think the approach I was following was not the correct one. Now, instead of adding a second document to the template, I am replacing the first one (which I have uploaded as a kind of placeholder to have all the fields and the signature placeholder defined) with a dynamically generated one. That seems to work fine and it actually addresses my requirements in a better way. 

Jorge


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